[Python-checkins] cpython (3.6): Issue #28333: Fixes off-by-one error that was adding an extra space.

steve.dower python-checkins at python.org
Tue Oct 25 14:52:43 EDT 2016


https://hg.python.org/cpython/rev/6b46c3deea2c
changeset: 104727:6b46c3deea2c
branch: 3.6
parent: 104725:84a3c5003510
user: Steve Dower <steve.dower at microsoft.com>
date: Tue Oct 25 11:51:54 2016 -0700
summary:
 Issue #28333: Fixes off-by-one error that was adding an extra space.
files:
 Parser/myreadline.c | 3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/Parser/myreadline.c b/Parser/myreadline.c
--- a/Parser/myreadline.c
+++ b/Parser/myreadline.c
@@ -225,7 +225,8 @@
 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);
 }
-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /