]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
oct(0) should return '0', not '00'
authorGuido van Rossum <guido@python.org>
Fri, 14 Aug 1992 15:13:07 +0000 (15:13 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 14 Aug 1992 15:13:07 +0000 (15:13 +0000)
Objects/longobject.c

index f9e37650f3281acb16234090fdd5c60a96acc90f..7ede30c0e17e14a11ea60d79b142552f3847d7dd 100644 (file)
@@ -322,8 +322,10 @@ long_format(aa, base)
                })
        } while (ABS(a->ob_size) != 0);
        DECREF(a);
-       if (base == 8)
-               *--p = '0';
+       if (base == 8) {
+               if (size_a != 0)
+                       *--p = '0';
+       }
        else if (base == 16) {
                *--p = 'x';
                *--p = '0';