summaryrefslogtreecommitdiff
path: root/misc/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'misc/util.c')
-rw-r--r--misc/util.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/misc/util.c b/misc/util.c
index 0ca5e6b..628270d 100644
--- a/misc/util.c
+++ b/misc/util.c
@@ -18,17 +18,27 @@
#include "misc/util.h"
-int alloc_printf(char **s, const char *fmt, ...)
+int alloc_vprintf(char **s, const char *fmt, va_list ap)
{
- va_list ap;
int res;
- va_start(ap, fmt);
res = vasprintf(s, fmt, ap);
- va_end(ap);
if (res == -1) {
perror("vasprintf");
exit(1);
}
return res;
}
+
+
+
+int alloc_printf(char **s, const char *fmt, ...)
+{
+ va_list ap;
+ int res;
+
+ va_start(ap, fmt);
+ res = alloc_vprintf(s, fmt, ap);
+ va_end(ap);
+ return res;
+}