aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--main/pbx.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/main/pbx.c b/main/pbx.c
index a0083a0af..2a10e9b00 100644
--- a/main/pbx.c
+++ b/main/pbx.c
@@ -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;