* through calling one of the other functions or macros defined in this
* file.
*/
-int __attribute__((format(printf, 4, 0))) __ast_str_helper(struct ast_str **buf, size_t max_len,
+int __attribute__((format(printf, 4, 0))) __ast_str_helper(struct ast_str **buf, ssize_t max_len,
int append, const char *fmt, va_list ap);
/*!
*/
AST_INLINE_API(
int __attribute__((format(printf, 3, 4))) ast_str_set(
- struct ast_str **buf, size_t max_len, const char *fmt, ...),
+ struct ast_str **buf, ssize_t max_len, const char *fmt, ...),
{
int res;
va_list ap;
*/
AST_INLINE_API(
int __attribute__((format(printf, 3, 4))) ast_str_append(
- struct ast_str **buf, size_t max_len, const char *fmt, ...),
+ struct ast_str **buf, ssize_t max_len, const char *fmt, ...),
{
int res;
va_list ap;
* ast_str_append_va(...)
*/
-int __ast_str_helper(struct ast_str **buf, size_t max_len,
+int __ast_str_helper(struct ast_str **buf, ssize_t max_len,
int append, const char *fmt, va_list ap)
{
int res, need;
return AST_DYNSTR_BUILD_RETRY;
}
/* update space used, keep in mind the truncation */
- (*buf)->used = (res + offset > (*buf)->len) ? (*buf)->len : res + offset;
+ (*buf)->used = (res + offset > (*buf)->len) ? (*buf)->len - 1 : res + offset;
return res;
}