summaryrefslogtreecommitdiff
path: root/funcs/func_math.c
diff options
context:
space:
mode:
authorTilghman Lesher <tilghman@meg.abyt.es>2010-01-21 05:54:30 +0000
committerTilghman Lesher <tilghman@meg.abyt.es>2010-01-21 05:54:30 +0000
commit44a9aab93af69ca17fd7d74281fcf6fd5f942fdb (patch)
treef2dc0dd2a7c7e7bbdab33085bbd632118a8c4e98 /funcs/func_math.c
parente469483d82e420c801b6de87e421b298e793ab64 (diff)
Merged revisions 241765 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r241765 | tilghman | 2010-01-20 23:53:17 -0600 (Wed, 20 Jan 2010) | 2 lines Guard against division by zero. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@241766 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'funcs/func_math.c')
-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 ab174d944..761c63228 100644
--- a/funcs/func_math.c
+++ b/funcs/func_math.c
@@ -289,7 +289,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;
}