mini-gmp: mpz_init_set_str fails on leading zeroes

Torbjörn Granlund tg at
Wed Jul 20 21:13:15 UTC 2016

Austyn Krutsinger <akrutsinger at> writes:

  My initial though was to just skip the leading zero's in the mpz_set_str
  function by something like this:
    while (isspace( (unsigned char) *sp) || (*sp == '0'))
  Only problems is that this doesn't work for negative numbers that still
  have a bunch of leading zeros;
I think we should not accept strings like 00000-0000017.

Please encrypt, key id 0xC8601622

More information about the gmp-bugs mailing list