summaryrefslogtreecommitdiff
path: root/Parser
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@microsoft.com>2016-10-25 11:51:54 -0700
committerSteve Dower <steve.dower@microsoft.com>2016-10-25 11:51:54 -0700
commit6c2b9d3479fbd425e0136abaadec4577b7918dbb (patch)
treea6518b3995a732345092ee0632d1985e78b5af45 /Parser
parent26231bb317d162eeae7d62942c2cfc7f2924cea2 (diff)
downloadcpython-git-6c2b9d3479fbd425e0136abaadec4577b7918dbb.tar.gz
Issue #28333: Fixes off-by-one error that was adding an extra space.
Diffstat (limited to 'Parser')
-rw-r--r--Parser/myreadline.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Parser/myreadline.c b/Parser/myreadline.c
index e40951ca33..9f3c2e343c 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);
}