mirror of
https://github.com/python/cpython.git
synced 2025-08-02 16:13:13 +00:00
Increased buffer sizes used by hex() and oct() -- on 64-bit or 128-bit
machines, the string may get longer than 20 characters!
This commit is contained in:
parent
7a515b9156
commit
6f72f97c03
1 changed files with 2 additions and 2 deletions
|
@ -721,7 +721,7 @@ static object *
|
|||
int_oct(v)
|
||||
intobject *v;
|
||||
{
|
||||
char buf[20];
|
||||
char buf[100];
|
||||
long x = v -> ob_ival;
|
||||
if (x == 0)
|
||||
strcpy(buf, "0");
|
||||
|
@ -734,7 +734,7 @@ static object *
|
|||
int_hex(v)
|
||||
intobject *v;
|
||||
{
|
||||
char buf[20];
|
||||
char buf[100];
|
||||
long x = v -> ob_ival;
|
||||
sprintf(buf, "0x%lx", x);
|
||||
return newstringobject(buf);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue