oct(0) should return '0', not '00'

This commit is contained in:
Guido van Rossum 1992-08-14 15:13:07 +00:00
parent 96caaee836
commit 2c475427c2

View 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';