From: Anthony Minessale Date: Fri, 2 Jul 2010 18:00:29 +0000 (-0500) Subject: fix new util function to actually do what it says it will X-Git-Tag: v1.2-rc1~563^2~25 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a7d8f866fd79af7ba2230b19f55329d59ef6c34a;p=thirdparty%2Ffreeswitch.git fix new util function to actually do what it says it will --- diff --git a/src/include/switch_utils.h b/src/include/switch_utils.h index 514f78d0d8..9c5f7202ac 100644 --- a/src/include/switch_utils.h +++ b/src/include/switch_utils.h @@ -105,16 +105,18 @@ static inline char *switch_strchr_strict(const char *in, char find, const char * while(p && *p) { const char *a = allowed; - int found = 0; + int acceptable = 0; + + if (*p == find) break; if (!a) { - found = 1; + acceptable = 1; } else { while(a && *a) { if (*p == *a) { - found = 1; + acceptable = 1; break; } @@ -123,9 +125,7 @@ static inline char *switch_strchr_strict(const char *in, char find, const char * } - if (!found) return NULL; - - if (*p == find) break; + if (!acceptable) return NULL; p++; }