]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
slightly simplify a loop and replace an open coded version of ast_skip_blanks
authorRussell Bryant <russell@russellbryant.com>
Fri, 21 Jul 2006 23:58:14 +0000 (23:58 +0000)
committerRussell Bryant <russell@russellbryant.com>
Fri, 21 Jul 2006 23:58:14 +0000 (23:58 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38068 65c4cc65-6c06-0410-ace0-fbb531ad65f3

logger.c

index 567019dbe493dcb232523dbeda28f1e36fb3f8ca..d7c70f0ec5e8f14ac27d25e5740734051d9c5e05 100644 (file)
--- a/logger.c
+++ b/logger.c
@@ -148,12 +148,10 @@ static int make_components(char *s, int lineno)
 {
        char *w;
        int res = 0;
-       char *stringp=NULL;
-       stringp=s;
-       w = strsep(&stringp, ",");
-       while(w) {
-               while(*w && (*w < 33))
-                       w++;
+       char *stringp = s;
+
+       while ((w = strsep(&stringp, ","))) {
+               w = ast_skip_blanks(w);
                if (!strcasecmp(w, "error")) 
                        res |= (1 << __LOG_ERROR);
                else if (!strcasecmp(w, "warning"))
@@ -171,8 +169,8 @@ static int make_components(char *s, int lineno)
                else {
                        fprintf(stderr, "Logfile Warning: Unknown keyword '%s' at line %d of logger.conf\n", w, lineno);
                }
-               w = strsep(&stringp, ",");
        }
+
        return res;
 }