don't count on NULL termination of returned strings

svn path=/trunk/; revision=8036
This commit is contained in:
Martin Fuchs 2004-02-05 08:23:50 +00:00
parent 49f02ee444
commit 702870db9d

View file

@ -66,15 +66,15 @@ void RegDirectory::read_directory(int scan_flags)
break;
w32fd.dwFileAttributes |= FILE_ATTRIBUTE_DIRECTORY;
lstrcpy(w32fd.cFileName, name);
_tcsncpy(w32fd.cFileName, name, name_len);
_tcscpy(pname, name);
entry = new RegDirectory(this, buffer, _hKeyRoot);
memcpy(&entry->_data, &w32fd, sizeof(WIN32_FIND_DATA));
if (*class_name)
entry->_type_name = _tcsdup(class_name);
if (class_len)
entry->_type_name = _tcsdup(String(class_name, class_len));
if (!first_entry)
first_entry = entry;