summaryrefslogtreecommitdiff
path: root/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'utils.c')
-rwxr-xr-xutils.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/utils.c b/utils.c
index 79d733605..fd99d581f 100755
--- a/utils.c
+++ b/utils.c
@@ -522,17 +522,14 @@ char *ast_strip_quoted(char *s, const char *beg_quotes, const char *end_quotes)
return s;
}
-int ast_build_string(char **buffer, size_t *space, const char *fmt, ...)
+int ast_build_string_va(char **buffer, size_t *space, const char *fmt, va_list ap)
{
- va_list ap;
int result;
if (!buffer || !*buffer || !space || !*space)
return -1;
- va_start(ap, fmt);
result = vsnprintf(*buffer, *space, fmt, ap);
- va_end(ap);
if (result < 0)
return -1;
@@ -544,6 +541,18 @@ int ast_build_string(char **buffer, size_t *space, const char *fmt, ...)
return 0;
}
+int ast_build_string(char **buffer, size_t *space, const char *fmt, ...)
+{
+ va_list ap;
+ int result;
+
+ va_start(ap, fmt);
+ result = ast_build_string_va(buffer, space, fmt, ap);
+ va_end(ap);
+
+ return result;
+}
+
int ast_true(const char *s)
{
if (!s || ast_strlen_zero(s))