Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 013024e

Browse files
committed
Fix compilation error of traceback.c on Windows
Issue #26564.
1 parent 32f2eb4 commit 013024e

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Python/traceback.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -509,13 +509,13 @@ _Py_DumpDecimal(int fd, unsigned long value)
509509
static void
510510
dump_hexadecimal(int fd, unsigned long value, Py_ssize_t width)
511511
{
512-
Py_ssize_t size = sizeof(unsigned long) * 2;
513-
char buffer[size + 1], *ptr, *end;
512+
char buffer[sizeof(unsigned long) * 2 + 1], *ptr, *end;
513+
const Py_ssize_t size = Py_ARRAY_LENGTH(buffer) - 1;
514514

515515
if (width > size)
516516
width = size;
517517

518-
end = &buffer[Py_ARRAY_LENGTH(buffer) - 1];
518+
end = &buffer[size];
519519
ptr = end;
520520
*ptr = '\0';
521521
do {

0 commit comments

Comments
 (0)