aboutsummaryrefslogtreecommitdiffstats
path: root/logger.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-07-21 23:58:14 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-07-21 23:58:14 +0000
commit89e319954318210c7b32ce1b8ef0edbec89ff44b (patch)
tree088ffa8fc30d54e77d2dc4229b307ac983eb02db /logger.c
parent17d5d2fdb799f2838aca5c24b3a8a6fdaaf5b32d (diff)
slightly simplify a loop and replace an open coded version of ast_skip_blanks
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38068 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'logger.c')
-rw-r--r--logger.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/logger.c b/logger.c
index 567019dbe..d7c70f0ec 100644
--- 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;
}