don't unnecessarily open-code strchr()
authorKevin P. Fleming <kpfleming@digium.com>
Sat, 2 Apr 2005 23:20:11 +0000 (23:20 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Sat, 2 Apr 2005 23:20:11 +0000 (23:20 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5361 65c4cc65-6c06-0410-ace0-fbb531ad65f3

logger.c

index 96650c8..ca0e34a 100755 (executable)
--- a/logger.c
+++ b/logger.c
@@ -606,16 +606,15 @@ void close_logger(void)
 
 static void strip_coloring(char *str)
 {
-       char *src = str, *dest, *end;
+       char *src, *dest, *end;
        
        if (!src)
                return;
 
        /* find the first potential escape sequence in the string */
 
-       while (*src && (*src != '\033'))
-               src++;
-       if (!*src)
+       src = strchr(str, '\033');
+       if (!src)
                return;
 
        dest = src;