Index: main/pbx.c =================================================================== --- main/pbx.c (revision 194141) +++ main/pbx.c (working copy) @@ -6775,11 +6775,10 @@ /* 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;