From a7d8f866fd79af7ba2230b19f55329d59ef6c34a Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Fri, 2 Jul 2010 13:00:29 -0500 Subject: [PATCH] fix new util function to actually do what it says it will --- src/include/switch_utils.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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++; }