]> granicus.if.org Git - python/commitdiff
Increased buffer sizes used by hex() and oct() -- on 64-bit or 128-bit
authorGuido van Rossum <guido@python.org>
Tue, 14 Jan 1997 15:43:41 +0000 (15:43 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 14 Jan 1997 15:43:41 +0000 (15:43 +0000)
machines, the string may get longer than 20 characters!

Objects/intobject.c

index 76d914584dac1b64eaf7d4bffe5e84a1f7bd95cb..1f1298f0a266bd9ac9c60d77d4b9260395f87232 100644 (file)
@@ -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);