Commit 2dd1b3b6 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

cmd: Reserve a place in buffer for NULL terminator.

parent 78f38a74
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment