Skip to content

Commit 7f5f6f1

Browse files
committed
tovec
1 parent 08a5858 commit 7f5f6f1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/integer_common.h

+6-1
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,12 @@ struct integer {
196196

197197
size_t count;
198198
mpz_export(res.data(), &count, -1, 8, 0, 0, impl);
199-
res.resize(count);
199+
if (count == 0) {
200+
res.resize(1);
201+
res[0]=0;
202+
}
203+
else
204+
res.resize(count);
200205

201206
return res;
202207
}

0 commit comments

Comments
 (0)