about summary refs log tree commit diff
path: root/src/stdio/asprintf.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/stdio/asprintf.c')
-rw-r--r--src/stdio/asprintf.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/stdio/asprintf.c b/src/stdio/asprintf.c
new file mode 100644
index 00000000..79e59c2d
--- /dev/null
+++ b/src/stdio/asprintf.c
@@ -0,0 +1,14 @@
+#include <stdio.h>
+#include <stdarg.h>
+
+int vasprintf(char **, const char *, va_list);
+
+int asprintf(char **s, const char *fmt, ...)
+{
+	int ret;
+	va_list ap;
+	va_start(ap, fmt);
+	ret = vasprintf(s, fmt, ap);
+	va_end(ap);
+	return ret;
+}