X-Git-Url: https://git.reactos.org/?p=reactos.git;a=blobdiff_plain;f=base%2Fsystem%2Fwinlogon%2Fscreensaver.c;h=17423e58f3781844dd0ef57e3bd615ae1b1dfb45;hp=43737dbdb01511e9c6537add3c01cfd5a1bb181d;hb=2bce4e0e52c5c38601bfd1e519812cb401eb23e6;hpb=c501d8112c9b01b1922f302d09e7eac2afc49c07;ds=inline diff --git a/base/system/winlogon/screensaver.c b/base/system/winlogon/screensaver.c index 43737dbdb01..17423e58f37 100644 --- a/base/system/winlogon/screensaver.c +++ b/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)- 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;