From 702870db9d24b03ae6fb405490726868607da937 Mon Sep 17 00:00:00 2001 From: Martin Fuchs Date: Thu, 5 Feb 2004 08:23:50 +0000 Subject: [PATCH] don't count on NULL termination of returned strings svn path=/trunk/; revision=8036 --- reactos/subsys/system/explorer/shell/regfs.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reactos/subsys/system/explorer/shell/regfs.cpp b/reactos/subsys/system/explorer/shell/regfs.cpp index aa09ab2788d..f54414b53cd 100644 --- a/reactos/subsys/system/explorer/shell/regfs.cpp +++ b/reactos/subsys/system/explorer/shell/regfs.cpp @@ -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;