mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
bigint.c (digits): check zero length bigint.
This commit is contained in:
@@ -90,6 +90,8 @@ static size_t
|
||||
digits(mpz_t *x)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
if (x->sz == 0) return 0;
|
||||
for (i = (x->sz) - 1; (x->p)[i] == 0 ; i--)
|
||||
if (i == 0) break;
|
||||
return i+1;
|
||||
|
||||
Reference in New Issue
Block a user