diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-01-21 05:56:01 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-01-21 05:56:01 +0000 |
commit | dd72dececbf622e72696b075a41f08b5f35ad8a7 (patch) | |
tree | a281847d7de5c7c252bf10451a77a054f40bb2d9 | |
parent | 37a7be726263b9eea0efe0abb9ee27fcd3abd103 (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.1@241768 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | funcs/func_math.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/funcs/func_math.c b/funcs/func_math.c index 9179ff743..a9217d8f3 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; } |