aboutsummaryrefslogtreecommitdiffstats
path: root/funcs
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-01-21 05:56:09 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-01-21 05:56:09 +0000
commitaeb8dd0eb559ed71edb36024c1c2ba25bdaf0853 (patch)
tree292f994c6a4dab248b84af78c72bc51a6a1e8c5c /funcs
parent776e0b750e4731f9708f29591cdbcbaaa79f1e38 (diff)
Merged revisions 241766 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ................ r241766 | tilghman | 2010-01-20 23:54:30 -0600 (Wed, 20 Jan 2010) | 9 lines 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: http://svn.digium.com/svn/asterisk/branches/1.6.2@241769 f38db490-d61c-443f-a65b-d21fe96a405b
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 427f361ce..99c4ac35c 100644
--- a/funcs/func_math.c
+++ b/funcs/func_math.c
@@ -253,7 +253,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;
}