summaryrefslogtreecommitdiffstats
path: root/src/evaluate.c
diff options
context:
space:
mode:
authorSteven Barth <cyrus@openwrt.org>2015-01-06 23:40:24 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2015-01-07 13:08:43 +0100
commit58b0957c48506083addde7a302ce82225002eb2f (patch)
treed3743f763f7af997af72d992ae2364fdb086d390 /src/evaluate.c
parent95af7f0a4c87894ef818f248845e1954fa780bec (diff)
erec: use stdio vasprintf instead of gmp_vasprintf
Use stdio's vasprintf instead of gmp_vasprintf which is not part of the mini-gmp function subset. Furthermore convert the only gmp-specific user and allow the compiler to verify format-strings. Signed-off-by: Steven Barth <cyrus@openwrt.org> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/evaluate.c')
-rw-r--r--src/evaluate.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/evaluate.c b/src/evaluate.c
index 2c4e8116..43fb9681 100644
--- a/src/evaluate.c
+++ b/src/evaluate.c
@@ -232,9 +232,13 @@ static int expr_evaluate_value(struct eval_ctx *ctx, struct expr **expr)
case TYPE_INTEGER:
mpz_init_bitmask(mask, ctx->ectx.len);
if (mpz_cmp((*expr)->value, mask) > 0) {
+ char *valstr = mpz_get_str(NULL, 10, (*expr)->value);
+ char *rangestr = mpz_get_str(NULL, 10, mask);
expr_error(ctx->msgs, *expr,
- "Value %Zu exceeds valid range 0-%Zu",
- (*expr)->value, mask);
+ "Value %s exceeds valid range 0-%s",
+ valstr, rangestr);
+ free(valstr);
+ free(rangestr);
mpz_clear(mask);
return -1;
}