[Python-checkins] cpython (merge 3.6 -> default): 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/44d15ba67d2e
changeset: 104728:44d15ba67d2e
parent: 104726:665171386c65
parent: 104727:6b46c3deea2c
user: Steve Dower <steve.dower at microsoft.com>
date: Tue Oct 25 11:52:09 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 によって変換されたページ (->オリジナル) /