From 1c65b2ed5793a4753ebab8f647daaac35707bb14 Mon Sep 17 00:00:00 2001 From: Art Yerkes Date: Tue, 23 Sep 2008 10:17:27 +0000 Subject: [PATCH] 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 --- reactos/base/system/winlogon/screensaver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reactos/base/system/winlogon/screensaver.c b/reactos/base/system/winlogon/screensaver.c index 635651b5a6c..17423e58f37 100644 --- a/reactos/base/system/winlogon/screensaver.c +++ b/reactos/base/system/winlogon/screensaver.c @@ -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;