From: Steve Dower Date: Tue, 25 Oct 2016 18:51:54 +0000 (-0700) Subject: Issue #28333: Fixes off-by-one error that was adding an extra space. X-Git-Tag: v3.6.0b3~49 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6c2b9d3479fbd425e0136abaadec4577b7918dbb;p=thirdparty%2FPython%2Fcpython.git Issue #28333: Fixes off-by-one error that was adding an extra space. --- diff --git a/Parser/myreadline.c b/Parser/myreadline.c index e40951ca33ee..9f3c2e343c03 100644 --- a/Parser/myreadline.c +++ b/Parser/myreadline.c @@ -225,7 +225,8 @@ PyOS_StdioReadline(FILE *sys_stdin, FILE *sys_stdout, const char *prompt) if (wlen) { DWORD n; fflush(stderr); - WriteConsoleW(hStdErr, wbuf, wlen, &n, NULL); + /* wlen includes null terminator, so subtract 1 */ + WriteConsoleW(hStdErr, wbuf, wlen - 1, &n, NULL); } PyMem_RawFree(wbuf); }