[asterisk-commits] kpfleming: trunk r42185 - /trunk/main/utils.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed Sep 6 17:41:27 MST 2006


Author: kpfleming
Date: Wed Sep  6 19:41:27 2006
New Revision: 42185

URL: http://svn.digium.com/view/asterisk?rev=42185&view=rev
Log:
don't try to get the length of the string in the ast_dynamic_str object unless we know there is actually one there

Modified:
    trunk/main/utils.c

Modified: trunk/main/utils.c
URL: http://svn.digium.com/view/asterisk/trunk/main/utils.c?rev=42185&r1=42184&r2=42185&view=diff
==============================================================================
--- trunk/main/utils.c (original)
+++ trunk/main/utils.c Wed Sep  6 19:41:27 2006
@@ -1199,7 +1199,7 @@
 	struct ast_threadstorage *ts, int append, const char *fmt, va_list ap)
 {
 	int res;
-	int offset = append ? strlen((*buf)->str) : 0;
+	int offset = (append && (*buf)->len) ? strlen((*buf)->str) : 0;
 
 	res = vsnprintf((*buf)->str + offset, (*buf)->len - offset, fmt, ap);
 



More information about the asterisk-commits mailing list