aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--funcs/func_math.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/funcs/func_math.c b/funcs/func_math.c
index 663cc5daf..d4d0cb1dc 100644
--- a/funcs/func_math.c
+++ b/funcs/func_math.c
@@ -224,7 +224,11 @@ static int math(struct ast_channel *chan, const char *cmd, char *parse,
int inum1 = fnum1;
int inum2 = fnum2;
- ftmp = (inum1 % inum2);
+ if (inum2 == 0) {
+ ftmp = 0;
+ } else {
+ ftmp = (inum1 % inum2);
+ }
break;
}