summaryrefslogtreecommitdiff
path: root/bignum.c
diff options
context:
space:
mode:
Diffstat (limited to 'bignum.c')
-rw-r--r--bignum.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/bignum.c b/bignum.c
index e49a18b118..e6ecb3933b 100644
--- a/bignum.c
+++ b/bignum.c
@@ -104,6 +104,7 @@ bigtrunc(x)
long len = RBIGNUM(x)->len;
BDIGIT *ds = BDIGITS(x);
+ if (len == 0) return x;
while (--len && !ds[len]);
RBIGNUM(x)->len = ++len;
return x;