[Asterisk-cvs] asterisk logger.c,1.62,1.63

kpfleming at lists.digium.com kpfleming at lists.digium.com
Sat Apr 2 17:27:08 CST 2005


Update of /usr/cvsroot/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv9781

Modified Files:
	logger.c 
Log Message:
don't unnecessarily open-code strchr()


Index: logger.c
===================================================================
RCS file: /usr/cvsroot/asterisk/logger.c,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -d -r1.62 -r1.63
--- logger.c	1 Apr 2005 23:49:57 -0000	1.62
+++ logger.c	2 Apr 2005 23:20:11 -0000	1.63
@@ -606,16 +606,15 @@
 
 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;




More information about the svn-commits mailing list