summaryrefslogtreecommitdiff
path: root/ifparser.c
diff options
context:
space:
mode:
Diffstat (limited to 'ifparser.c')
-rw-r--r--ifparser.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ifparser.c b/ifparser.c
index 631b4f0..42138f8 100644
--- a/ifparser.c
+++ b/ifparser.c
@@ -338,7 +338,10 @@ parse_product(IfParser *g, const char *cp, long *valp)
case '%':
DO(cp = parse_product(g, cp + 1, &rightval));
- *valp = (*valp % rightval);
+ if (rightval)
+ *valp = (*valp % rightval);
+ else
+ *valp = LONG_MAX;
break;
}
return cp;