]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
If the timing ended on a zero, then we would loop forever.
authorTilghman Lesher <tilghman@meg.abyt.es>
Thu, 14 May 2009 16:22:14 +0000 (16:22 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Thu, 14 May 2009 16:22:14 +0000 (16:22 +0000)
(closes issue #14983)
 Reported by: teox
 Patches:
       20090513__issue14983.diff.txt uploaded by tilghman (license 14)
 Tested by: teox

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@194430 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/pbx.c

index a0083a0af1ed6fbb1b4fe31fefd37177e2d9b19b..2a10e9b001d9c7165b227e344ddd33d9226eaa14 100644 (file)
@@ -7083,11 +7083,10 @@ static unsigned get_range(char *src, int max, char *const names[], const char *m
                /* Fill the mask. Remember that ranges are cyclic */
                mask |= (1 << end);   /* initialize with last element */
                while (start != end) {
-                       if (start >= max) {
+                       mask |= (1 << start);
+                       if (++start >= max) {
                                start = 0;
                        }
-                       mask |= (1 << start);
-                       start++;
                }
        }
        return mask;