diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-01-21 05:54:30 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-01-21 05:54:30 +0000 |
commit | 31d9fa0da5bd5229e334f5832462f64787816d3e (patch) | |
tree | f2dc0dd2a7c7e7bbdab33085bbd632118a8c4e98 /funcs/func_math.c | |
parent | ee8e1dff15a38f522c684c0ba2e70c2532de7fd7 (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: http://svn.digium.com/svn/asterisk/trunk@241766 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'funcs/func_math.c')
-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 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; } |