summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@microsoft.com>2016-10-25 18:52:09 (GMT)
committerSteve Dower <steve.dower@microsoft.com>2016-10-25 18:52:09 (GMT)
commit85fd15adad170350093eefd7bc98000b01318d32 (patch)
tree62aa4c6ecae8d101bdc574845db17b9ab117c9eb
parent670fca8d1725080b94ce078c7b0c6db49104c7ae (diff)
parent6c2b9d3479fbd425e0136abaadec4577b7918dbb (diff)
downloadcpython-85fd15adad170350093eefd7bc98000b01318d32.zip
cpython-85fd15adad170350093eefd7bc98000b01318d32.tar.gz
cpython-85fd15adad170350093eefd7bc98000b01318d32.tar.bz2
Issue #28333: Fixes off-by-one error that was adding an extra space.
-rw-r--r--Parser/myreadline.c3
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);
}