[svn-commits] branch 1.2 r21037 - /branches/1.2/apps/app_random.c

svn-commits at lists.digium.com svn-commits at lists.digium.com
Mon Apr 17 23:26:05 MST 2006


Author: tilghman
Date: Tue Apr 18 01:26:04 2006
New Revision: 21037

URL: http://svn.digium.com/view/asterisk?rev=21037&view=rev
Log:
Bug 6984 - off by one error in Random()

Modified:
    branches/1.2/apps/app_random.c

Modified: branches/1.2/apps/app_random.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/apps/app_random.c?rev=21037&r1=21036&r2=21037&view=diff
==============================================================================
--- branches/1.2/apps/app_random.c (original)
+++ branches/1.2/apps/app_random.c Tue Apr 18 01:26:04 2006
@@ -82,7 +82,7 @@
 	if ((!prob) || (sscanf(prob, "%d", &probint) != 1))
 		probint = 0;
 
-	if ((random() % 100) + probint > 100) {
+	if ((random() % 100) + probint >= 100) {
 		res = ast_parseable_goto(chan, s);
 		if (option_verbose > 2)
 			ast_verbose( VERBOSE_PREFIX_3 "Random branches to (%s,%s,%d)\n",



More information about the svn-commits mailing list