Didn't notice that bufferSize is used by RegQueryValueEx. Now we count in

bytes with bufferSize and count in chars just in the subscript.

Noticed by Christoph_Vw

svn path=/trunk/; revision=36424
This commit is contained in:
Art Yerkes
2008-09-23 10:17:27 +00:00
parent 99f3a239d7
commit 1c65b2ed57
+2 -2
View File
@@ -243,7 +243,7 @@ StartScreenSaver(
HKEY hKey = NULL;
WCHAR szApplicationName[MAX_PATH];
WCHAR szCommandLine[MAX_PATH + 3];
DWORD bufferSize = (sizeof(szApplicationName) / sizeof(WCHAR)) - 1;
DWORD bufferSize = sizeof(szApplicationName) - sizeof(WCHAR);
DWORD dwType;
STARTUPINFOW StartupInfo;
PROCESS_INFORMATION ProcessInformation;
@@ -280,7 +280,7 @@ StartScreenSaver(
if (bufferSize == 0)
goto cleanup;
szApplicationName[bufferSize] = 0; /* Terminate the string */
szApplicationName[bufferSize / sizeof(WCHAR)] = 0; /* Terminate the string */
if (wcslen(szApplicationName) == 0)
goto cleanup;