diff options
author | Petre Rodan <2b4eda@subdimension.ro> | 2023-10-11 19:05:22 +0300 |
---|---|---|
committer | Petre Rodan <2b4eda@subdimension.ro> | 2023-10-11 19:05:22 +0300 |
commit | b34434f7b94862194d14674e702e8a3226181b86 (patch) | |
tree | 28ff223f895ed8003531e41c032e727e0ebebf09 /ifparser.c | |
parent | 48c4ae4742542f0c4d0c43993871f4c649f39f38 (diff) |
ifparser.c: divide-by-zero fix
Diffstat (limited to 'ifparser.c')
-rw-r--r-- | ifparser.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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; |