[asterisk-commits] russell: trunk r38068 - /trunk/logger.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Jul 21 16:58:15 MST 2006


Author: russell
Date: Fri Jul 21 18:58:14 2006
New Revision: 38068

URL: http://svn.digium.com/view/asterisk?rev=38068&view=rev
Log:
slightly simplify a loop and replace an open coded version of ast_skip_blanks

Modified:
    trunk/logger.c

Modified: trunk/logger.c
URL: http://svn.digium.com/view/asterisk/trunk/logger.c?rev=38068&r1=38067&r2=38068&view=diff
==============================================================================
--- trunk/logger.c (original)
+++ trunk/logger.c Fri Jul 21 18:58:14 2006
@@ -148,12 +148,10 @@
 {
 	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 @@
 		else {
 			fprintf(stderr, "Logfile Warning: Unknown keyword '%s' at line %d of logger.conf\n", w, lineno);
 		}
-		w = strsep(&stringp, ",");
-	}
+	}
+
 	return res;
 }
 



More information about the asterisk-commits mailing list