summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
Diffstat (limited to 'Objects')
-rw-r--r--Objects/longobject.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Objects/longobject.c b/Objects/longobject.c
index f9e3765..7ede30c 100644
--- a/Objects/longobject.c
+++ b/Objects/longobject.c
@@ -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';