diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-02-10 21:22:30 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-02-10 21:22:30 +0000 |
commit | edf286d27625b4e92cfa8822e20b3a0b72abdc7a (patch) | |
tree | 09c1b2d2b19d569304b8d3beeda406dd2f4dc2c8 /funcs | |
parent | 9331796b7fbd49e2168825705b373897e2b246dc (diff) |
Merged revisions 246200 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
........
r246200 | tilghman | 2010-02-10 15:19:35 -0600 (Wed, 10 Feb 2010) | 2 lines
Fix weird issue with unit tests on optimized build - turned out to be a signing issue.
........
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@246203 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'funcs')
-rw-r--r-- | funcs/func_strings.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/funcs/func_strings.c b/funcs/func_strings.c index eef3b6bf9..e242abddc 100644 --- a/funcs/func_strings.c +++ b/funcs/func_strings.c @@ -431,7 +431,8 @@ static int filter(struct ast_channel *chan, const char *cmd, char *parse, char * AST_APP_ARG(allowed); AST_APP_ARG(string); ); - char *outbuf = buf, ac; + char *outbuf = buf; + unsigned char ac; char allowed[256] = ""; size_t allowedlen = 0; int32_t bitfield[8] = { 0, }; /* 256 bits */ @@ -448,7 +449,7 @@ static int filter(struct ast_channel *chan, const char *cmd, char *parse, char * } /* Expand ranges */ - for (; *(args.allowed) && allowedlen < sizeof(allowed); ) { + for (; *(args.allowed);) { char c1 = 0, c2 = 0; size_t consumed = 0; @@ -472,13 +473,13 @@ static int filter(struct ast_channel *chan, const char *cmd, char *parse, char * for (ac = c1; ac != c2; ac++) { bitfield[ac / 32] |= 1 << (ac % 32); } + bitfield[ac / 32] |= 1 << (ac % 32); ast_debug(4, "c1=%d, c2=%d\n", c1, c2); - - /* Decrement before the loop increment */ - (args.allowed)--; } else { - bitfield[c1 / 32] |= 1 << (c1 % 32); + ac = (unsigned char) c1; + ast_debug(4, "c1=%d, consumed=%d, args.allowed=%s\n", c1, consumed, args.allowed - consumed); + bitfield[ac / 32] |= 1 << (ac % 32); } } |