[Python-checkins] cpython: Fix compilation error of traceback.c on Windows
victor.stinner
python-checkins at python.org
Wed Mar 16 04:46:07 EDT 2016
https://hg.python.org/cpython/rev/5f2284ecf9c6
changeset: 100558:5f2284ecf9c6
user: Victor Stinner <victor.stinner at gmail.com>
date: Wed Mar 16 09:43:14 2016 +0100
summary:
Fix compilation error of traceback.c on Windows
Issue #26564.
files:
Python/traceback.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/Python/traceback.c b/Python/traceback.c
--- a/Python/traceback.c
+++ b/Python/traceback.c
@@ -509,13 +509,13 @@
static void
dump_hexadecimal(int fd, unsigned long value, Py_ssize_t width)
{
- Py_ssize_t size = sizeof(unsigned long) * 2;
- char buffer[size + 1], *ptr, *end;
+ char buffer[sizeof(unsigned long) * 2 + 1], *ptr, *end;
+ const Py_ssize_t size = Py_ARRAY_LENGTH(buffer) - 1;
if (width > size)
width = size;
- end = &buffer[Py_ARRAY_LENGTH(buffer) - 1];
+ end = &buffer[size];
ptr = end;
*ptr = '\0';
do {
--
Repository URL: https://hg.python.org/cpython
More information about the Python-checkins
mailing list