This simplifies the integer parsing logic and restricts it to
functions being part of the mini-gmp subset.
Signed-off-by: Steven Barth <cyrus@openwrt.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
struct expr **res)
{
mpz_t v;
- int len;
mpz_init(v);
- if (gmp_sscanf(sym->identifier, "%Zu%n", v, &len) != 1 ||
- (int)strlen(sym->identifier) != len) {
+ if (mpz_set_str(v, sym->identifier, 0)) {
mpz_clear(v);
return error(&sym->location, "Could not parse %s",
sym->dtype->desc);