aboutsummaryrefslogtreecommitdiffstats
path: root/utils.c
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-10-01 15:41:27 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-10-01 15:41:27 +0000
commit997e6dd0d5f6f99b50dc88f06319e027530589f8 (patch)
tree72102d76a9b39e80750a94d47b4cf7d6061d7841 /utils.c
parent5f810e050b3d9bcc691f457561ea0c710d88c4b4 (diff)
add ast_build_string_va(), which accepts a varargs list directly
ensure the _entire_ manager_event() output is either queued or sent via ast_carefulwrite() git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6708 f38db490-d61c-443f-a65b-d21fe96a405b
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))