|
|
@ -131,6 +131,7 @@ char *__ast_str_helper2(struct ast_str **buf, size_t maxlen, const char *src, si
|
|
|
|
(*buf)->__AST_STR_USED++;
|
|
|
|
(*buf)->__AST_STR_USED++;
|
|
|
|
|
|
|
|
|
|
|
|
if (dynamic && (!maxlen || (escapecommas && !(maxlen - 1)))) {
|
|
|
|
if (dynamic && (!maxlen || (escapecommas && !(maxlen - 1)))) {
|
|
|
|
|
|
|
|
char *oldbase = (*buf)->__AST_STR_STR;
|
|
|
|
size_t old = (*buf)->__AST_STR_LEN;
|
|
|
|
size_t old = (*buf)->__AST_STR_LEN;
|
|
|
|
if (ast_str_make_space(buf, (*buf)->__AST_STR_LEN * 2)) {
|
|
|
|
if (ast_str_make_space(buf, (*buf)->__AST_STR_LEN * 2)) {
|
|
|
|
/* If the buffer can't be extended, end it. */
|
|
|
|
/* If the buffer can't be extended, end it. */
|
|
|
@ -138,6 +139,11 @@ char *__ast_str_helper2(struct ast_str **buf, size_t maxlen, const char *src, si
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/* What we extended the buffer by */
|
|
|
|
/* What we extended the buffer by */
|
|
|
|
maxlen = old;
|
|
|
|
maxlen = old;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Update ptr, if necessary */
|
|
|
|
|
|
|
|
if ((*buf)->__AST_STR_STR != oldbase) {
|
|
|
|
|
|
|
|
ptr = ptr - oldbase + (*buf)->__AST_STR_STR;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (__builtin_expect(!(maxsrc && maxlen), 0)) {
|
|
|
|
if (__builtin_expect(!(maxsrc && maxlen), 0)) {
|
|
|
|