1 parent cab27b5 commit d58d1caCopy full SHA for d58d1ca
1 file changed
Python/traceback.c
@@ -509,13 +509,13 @@ _Py_DumpDecimal(int fd, unsigned long value)
509
static void
510
dump_hexadecimal(int fd, unsigned long value, Py_ssize_t width)
511
{
512
- Py_ssize_t size = sizeof(unsigned long) * 2;
513
- 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;
514
515
if (width > size)
516
width = size;
517
518
- end = &buffer[Py_ARRAY_LENGTH(buffer) - 1];
+ end = &buffer[size];
519
ptr = end;
520
*ptr = '\0';
521
do {
0 commit comments