]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Bug 6984 - off by one error in Random()
authorTilghman Lesher <tilghman@meg.abyt.es>
Tue, 18 Apr 2006 06:26:04 +0000 (06:26 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Tue, 18 Apr 2006 06:26:04 +0000 (06:26 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@21037 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_random.c

index 57ef4dd323480c761df0c0e7e84190c83f399603..cab34f31e7e263a24041ba23822ec25c38dd653e 100644 (file)
@@ -82,7 +82,7 @@ static int random_exec(struct ast_channel *chan, void *data)
        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",