[asterisk-commits] tilghman: branch 1.4 r241765 - /branches/1.4/funcs/func_math.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed Jan 20 23:53:20 CST 2010
Author: tilghman
Date: Wed Jan 20 23:53:17 2010
New Revision: 241765
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=241765
Log:
Guard against division by zero.
Modified:
branches/1.4/funcs/func_math.c
Modified: branches/1.4/funcs/func_math.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.4/funcs/func_math.c?view=diff&rev=241765&r1=241764&r2=241765
==============================================================================
--- branches/1.4/funcs/func_math.c (original)
+++ branches/1.4/funcs/func_math.c Wed Jan 20 23:53:17 2010
@@ -199,7 +199,11 @@
int inum1 = fnum1;
int inum2 = fnum2;
- ftmp = (inum1 % inum2);
+ if (inum2 == 0) {
+ ftmp = 0;
+ } else {
+ ftmp = (inum1 % inum2);
+ }
break;
}
More information about the asterisk-commits
mailing list