]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix new util function to actually do what it says it will
authorAnthony Minessale <anthm@freeswitch.org>
Fri, 2 Jul 2010 18:00:29 +0000 (13:00 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Fri, 2 Jul 2010 18:00:29 +0000 (13:00 -0500)
src/include/switch_utils.h

index 514f78d0d89d545907be248e4fbb8c9e66812718..9c5f7202ac7acb2957376f8a2940e3c8cb89811f 100644 (file)
@@ -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++;
        }