diff options
Diffstat (limited to 'Parser/myreadline.c')
-rw-r--r-- | Parser/myreadline.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Parser/myreadline.c b/Parser/myreadline.c index e40951c..9f3c2e3 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); } |