mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-29 23:39:35 +00:00
Bug 6745 - Fix for ranges that wrap around the ends
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@13709 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
8
pbx.c
8
pbx.c
@@ -3728,10 +3728,14 @@ static unsigned get_range(char *src, int max, char *const names[], const char *m
|
|||||||
}
|
}
|
||||||
/* Fill the mask. Remember that ranges are cyclic */
|
/* Fill the mask. Remember that ranges are cyclic */
|
||||||
mask = 1 << e; /* initialize with last element */
|
mask = 1 << e; /* initialize with last element */
|
||||||
for ( ; s != e; s++) {
|
while (s != e) {
|
||||||
if (s == max)
|
if (s >= max) {
|
||||||
s = 0;
|
s = 0;
|
||||||
mask |= (1 << s);
|
mask |= (1 << s);
|
||||||
|
} else {
|
||||||
|
mask |= (1 << s);
|
||||||
|
s++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return mask;
|
return mask;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user