X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/b9d8b5586790946de2fef94e0b8c43d573a71090..54e7ce4ad20a6977ee895a358259122bf3630090:/src/src/expand.c diff --git a/src/src/expand.c b/src/src/expand.c index bf425ae81..06e0eb0ce 100644 --- a/src/src/expand.c +++ b/src/src/expand.c @@ -3107,7 +3107,16 @@ if (*error == NULL) int y = eval_op_unary(&s, decimal, error); if (*error != NULL) break; if (op == '*') x *= y; - else if (op == '/') x /= y; + else if (op == '/') + { + if (y == 0) + { + *error = US"divide by zero"; + x = 0; + break; + } + x /= y; + } else x %= y; } }