From 2dd1b3b6366e64cff1976a46f900e650cee56f66 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Tue, 17 Feb 2009 22:45:21 +0300 Subject: [PATCH] cmd: Reserve a place in buffer for NULL terminator. --- programs/cmd/builtins.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/programs/cmd/builtins.c b/programs/cmd/builtins.c index 6679b86ec6f..bcdf840e7bc 100644 --- a/programs/cmd/builtins.c +++ b/programs/cmd/builtins.c @@ -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);