mirror of
https://github.com/python/cpython.git
synced 2025-10-17 12:18:23 +00:00
parent
32f2eb4941
commit
013024ef67
1 changed files with 3 additions and 3 deletions
|
@ -509,13 +509,13 @@ _Py_DumpDecimal(int fd, unsigned long value)
|
||||||
static void
|
static void
|
||||||
dump_hexadecimal(int fd, unsigned long value, Py_ssize_t width)
|
dump_hexadecimal(int fd, unsigned long value, Py_ssize_t width)
|
||||||
{
|
{
|
||||||
Py_ssize_t size = sizeof(unsigned long) * 2;
|
char buffer[sizeof(unsigned long) * 2 + 1], *ptr, *end;
|
||||||
char buffer[size + 1], *ptr, *end;
|
const Py_ssize_t size = Py_ARRAY_LENGTH(buffer) - 1;
|
||||||
|
|
||||||
if (width > size)
|
if (width > size)
|
||||||
width = size;
|
width = size;
|
||||||
|
|
||||||
end = &buffer[Py_ARRAY_LENGTH(buffer) - 1];
|
end = &buffer[size];
|
||||||
ptr = end;
|
ptr = end;
|
||||||
*ptr = '\0';
|
*ptr = '\0';
|
||||||
do {
|
do {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue