From: Tilghman Lesher Date: Wed, 10 Feb 2010 21:21:26 +0000 (+0000) Subject: Merged revisions 246200 via svnmerge from X-Git-Tag: 1.6.1.18-rc1~50 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=27619090b2ed066496df63817f932abc8b97f972;p=thirdparty%2Fasterisk.git 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: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@246202 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/funcs/func_strings.c b/funcs/func_strings.c index ce54cd85f8..6a9a86125b 100644 --- a/funcs/func_strings.c +++ b/funcs/func_strings.c @@ -87,7 +87,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 */ @@ -104,7 +105,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; @@ -128,13 +129,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); } }