cmd: Reserve a place in buffer for NULL terminator.

This commit is contained in:
Nikolay Sivov 2009-02-17 22:45:21 +03:00 committed by Alexandre Julliard
parent 78f38a742f
commit 2dd1b3b636

View file

@ -2290,7 +2290,7 @@ void WCMD_type (WCHAR *command) {
static const WCHAR fmt[] = {'\n','%','s','\n','\n','\0'};
WCMD_output(fmt, thisArg);
}
while (WCMD_ReadFile (h, buffer, sizeof(buffer)/sizeof(WCHAR), &count, NULL)) {
while (WCMD_ReadFile (h, buffer, sizeof(buffer)/sizeof(WCHAR) - 1, &count, NULL)) {
if (count == 0) break; /* ReadFile reports success on EOF! */
buffer[count] = 0;
WCMD_output_asis (buffer);