Index: uspace/lib/c/generic/io/asprintf.c
===================================================================
--- uspace/lib/c/generic/io/asprintf.c	(revision 2cc1ec062d6e172ce570169e6b0485b9da3db610)
+++ uspace/lib/c/generic/io/asprintf.c	(revision a9763c666a17a9e61eed93a67919ee613c7f32a9)
@@ -76,4 +76,32 @@
  *             the newly allocated string.
  * @fmt        Format string.
+ * @args       Variable argument list
+ *
+ * @return Number of characters printed or a negative error code.
+ *
+ */
+int vasprintf(char **strp, const char *fmt, va_list args)
+{
+	va_list args2;
+	va_copy(args2, args);
+	int ret = vprintf_size(fmt, args2);
+	va_end(args2);
+	
+	if (ret > 0) {
+		*strp = malloc(STR_BOUNDS(ret) + 1);
+		if (*strp == NULL)
+			return -1;
+		
+		vsnprintf(*strp, STR_BOUNDS(ret) + 1, fmt, args);
+	}
+	
+	return ret;
+}
+
+/** Allocate and print to string.
+ *
+ * @param strp Address of the pointer where to store the address of
+ *             the newly allocated string.
+ * @fmt        Format string.
  *
  * @return Number of characters printed or a negative error code.
@@ -84,16 +112,6 @@
 	va_list args;
 	va_start(args, fmt);
-	int ret = vprintf_size(fmt, args);
+	int ret = vasprintf(strp, fmt, args);
 	va_end(args);
-	
-	if (ret > 0) {
-		*strp = malloc(STR_BOUNDS(ret) + 1);
-		if (*strp == NULL)
-			return -1;
-		
-		va_start(args, fmt);
-		vsnprintf(*strp, STR_BOUNDS(ret) + 1, fmt, args);
-		va_end(args);
-	}
 	
 	return ret;
Index: uspace/lib/c/include/stdio.h
===================================================================
--- uspace/lib/c/include/stdio.h	(revision 2cc1ec062d6e172ce570169e6b0485b9da3db610)
+++ uspace/lib/c/include/stdio.h	(revision a9763c666a17a9e61eed93a67919ee613c7f32a9)
@@ -120,4 +120,5 @@
 extern int snprintf(char *, size_t , const char *, ...)
     PRINTF_ATTRIBUTE(3, 4);
+extern int vasprintf(char **, const char *, va_list);
 extern int asprintf(char **, const char *, ...)
     PRINTF_ATTRIBUTE(2, 3);
Index: uspace/lib/posix/include/posix/stdio.h
===================================================================
--- uspace/lib/posix/include/posix/stdio.h	(revision 2cc1ec062d6e172ce570169e6b0485b9da3db610)
+++ uspace/lib/posix/include/posix/stdio.h	(revision a9763c666a17a9e61eed93a67919ee613c7f32a9)
@@ -107,4 +107,5 @@
 extern int snprintf(char *, size_t , const char *, ...) PRINTF_ATTRIBUTE(3, 4);
 #ifdef _GNU_SOURCE
+extern int vasprintf(char **, const char *, va_list);
 extern int asprintf(char **, const char *, ...) PRINTF_ATTRIBUTE(2, 3);
 #endif
