Don't force screensaver file names to have at least 4 chars

Terminate the string just after the last read character.

svn path=/trunk/; revision=24758
This commit is contained in:
Hervé Poussineau
2006-11-14 18:35:29 +00:00
parent 5a7f46becc
commit f651c1f8b6
+4 -4
View File
@@ -262,7 +262,6 @@ StartScreenSaver(
if (rc != ERROR_SUCCESS)
goto cleanup;
szApplicationName[bufferSize] = 0; /* Terminate the string */
rc = RegQueryValueExW(
hKey,
L"SCRNSAVE.EXE",
@@ -272,9 +271,10 @@ StartScreenSaver(
&bufferSize);
if (rc != ERROR_SUCCESS || dwType != REG_SZ)
goto cleanup;
if (bufferSize <=4)
goto cleanup;
if (bufferSize == 0)
goto cleanup;
szApplicationName[bufferSize] = 0; /* Terminate the string */
wsprintfW(szCommandLine, L"%s /s", szApplicationName);
TRACE("WL: Executing %S\n", szCommandLine);