Skip to content

Commit 6c2b9d3

Browse files
committed
Issue #28333: Fixes off-by-one error that was adding an extra space.
1 parent 26231bb commit 6c2b9d3

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Parser/myreadline.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,8 @@ PyOS_StdioReadline(FILE *sys_stdin, FILE *sys_stdout, const char *prompt)
225225
if (wlen) {
226226
DWORD n;
227227
fflush(stderr);
228-
WriteConsoleW(hStdErr, wbuf, wlen, &n, NULL);
228+
/* wlen includes null terminator, so subtract 1 */
229+
WriteConsoleW(hStdErr, wbuf, wlen - 1, &n, NULL);
229230
}
230231
PyMem_RawFree(wbuf);
231232
}

0 commit comments

Comments
 (0)