diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-11-29 05:08:19 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-11-29 05:08:19 +0000 |
commit | 02a84d116bf737c51416126290bb312756d9a044 (patch) | |
tree | 4adc5b6080d8115a60aedb603f9cf01e0d72aad5 /main/utils.c | |
parent | 92c4c39768c2575b8750e05bce6795ecfdff8fa3 (diff) |
Remove an XXX command suggesting that this truncation should not be conditional,
and also add a more verbose comment explaining why it is only needed in the
case of appending to the string for any curious readers that come along in the
future.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@48103 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/utils.c')
-rw-r--r-- | main/utils.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/main/utils.c b/main/utils.c index 5d1855448..555800bce 100644 --- a/main/utils.c +++ b/main/utils.c @@ -997,7 +997,14 @@ int ast_dynamic_str_thread_build_va(struct ast_dynamic_str **buf, size_t max_len return AST_DYNSTR_BUILD_FAILED; (*buf)->len = need; - /* Truncate the previous attempt. XXX this should be unconditional */ + /* Truncate the previous attempt. This is only needed for the + * append operation because if the write is from the beginning, + * it will get automatically overwritten when this function + * gets called again. When appending, if this was not done, + * this function would be called over and over again, because + * each attempt would be appending more and more partial + * strings, never having enough space to finish. + */ if (append) (*buf)->str[offset] = '\0'; |