aboutsummaryrefslogtreecommitdiffstats
path: root/include/asterisk/strings.h
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2009-01-09 18:30:55 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2009-01-09 18:30:55 +0000
commit205de4564cbe5841602d1018b59c61b4d7acf418 (patch)
tree819b3ea1eaeee30e84650f16a3a761e64f70c453 /include/asterisk/strings.h
parentf5972bb0a62fdf940e44c8af6b94837397629226 (diff)
When using ast_str with a non-ast_str-enabled API, we need to update the buffer
or otherwise, we cannot use ast_str_strlen(). git-svn-id: http://svn.digium.com/svn/asterisk/trunk@168090 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include/asterisk/strings.h')
-rw-r--r--include/asterisk/strings.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/asterisk/strings.h b/include/asterisk/strings.h
index 529456c98..bf3cf3236 100644
--- a/include/asterisk/strings.h
+++ b/include/asterisk/strings.h
@@ -403,6 +403,16 @@ void ast_str_reset(struct ast_str *buf),
}
)
+/*! \brief Update the length of the buffer, after using ast_str merely as a buffer.
+ * \param buf A pointer to the ast_str string.
+ */
+AST_INLINE_API(
+void ast_str_update(struct ast_str *buf),
+{
+ buf->__AST_STR_USED = strlen(buf->__AST_STR_STR);
+}
+)
+
/*! \brief Trims trailing whitespace characters from an ast_str string.
* \param buf A pointer to the ast_str string.
*/