aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2006-09-07 00:41:27 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2006-09-07 00:41:27 +0000
commitb3c4a6a9e771fd6dc9e2eb3f3cccee0590a1b939 (patch)
treef308529af474f2e9fb1389fb26fe69eb97f9eee1 /main
parent24e99a65a42ef81f973b7b82e30eadd68d9700d9 (diff)
don't try to get the length of the string in the ast_dynamic_str object unless we know there is actually one there
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@42185 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r--main/utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/main/utils.c b/main/utils.c
index 3a8e85f06..edb4102e0 100644
--- a/main/utils.c
+++ b/main/utils.c
@@ -1199,7 +1199,7 @@ int ast_dynamic_str_thread_build_va(struct ast_dynamic_str **buf, size_t max_len
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);