[Asterisk-cvs] asterisk utils.c,1.40,1.41

kpfleming at lists.digium.com kpfleming at lists.digium.com
Tue May 3 19:44:15 CDT 2005


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

Modified Files:
	utils.c 
Log Message:
fix breakage when ast_copy_string is used to copy substrings (bug #4146, but a different fix)


Index: utils.c
===================================================================
RCS file: /usr/cvsroot/asterisk/utils.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- utils.c	2 May 2005 00:27:54 -0000	1.40
+++ utils.c	3 May 2005 23:51:20 -0000	1.41
@@ -420,8 +420,10 @@
 
 void ast_copy_string(char *dst, const char *src, size_t size)
 {
-	while (*src && size--)
+	while (*src && size) {
 		*dst++ = *src++;
+		size--;
+	}
 	if (__builtin_expect(!size, 0))
 		dst--;
 	*dst = '\0';




More information about the svn-commits mailing list