aboutsummaryrefslogtreecommitdiffstats
path: root/funcs
diff options
context:
space:
mode:
Diffstat (limited to 'funcs')
-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 76d9deff6..18a2bd7a9 100644
--- a/funcs/func_math.c
+++ b/funcs/func_math.c
@@ -199,7 +199,11 @@ static int math(struct ast_channel *chan, char *cmd, char *parse,
int inum1 = fnum1;
int inum2 = fnum2;
- ftmp = (inum1 % inum2);
+ if (inum2 == 0) {
+ ftmp = 0;
+ } else {
+ ftmp = (inum1 % inum2);
+ }
break;
}