MINOR: standard: Add memvprintf function

Now memprintf relies on memvprintf. This new function does exactly what
memprintf did before, but it must be called with a va_list instead of a variable
number of arguments. So there is no change for every functions using
memprintf. But it is now also possible to have same functionnality from any
function with variadic arguments.
diff --git a/src/standard.c b/src/standard.c
index db312dd..77641b4 100644
--- a/src/standard.c
+++ b/src/standard.c
@@ -3309,8 +3309,11 @@
  *    if (!fct2(err)) report(*err);
  *    if (!fct3(err)) report(*err);
  *    free(*err);
+ *
+ * memprintf relies on memvprintf. This last version can be called from any
+ * function with variadic arguments.
  */
-char *memprintf(char **out, const char *format, ...)
+char *memvprintf(char **out, const char *format, va_list orig_args)
 {
 	va_list args;
 	char *ret = NULL;
@@ -3325,10 +3328,9 @@
 		 * target buffer is NULL. We do this in a loop just in case
 		 * intermediate evaluations get wrong.
 		 */
-		va_start(args, format);
+		va_copy(args, orig_args);
 		needed = vsnprintf(ret, allocated, format, args);
 		va_end(args);
-
 		if (needed < allocated) {
 			/* Note: on Solaris 8, the first iteration always
 			 * returns -1 if allocated is zero, so we force a
@@ -3358,6 +3360,18 @@
 	return ret;
 }
 
+char *memprintf(char **out, const char *format, ...)
+{
+	va_list args;
+	char *ret = NULL;
+
+	va_start(args, format);
+	ret = memvprintf(out, format, args);
+	va_end(args);
+
+	return ret;
+}
+
 /* Used to add <level> spaces before each line of <out>, unless there is only one line.
  * The input argument is automatically freed and reassigned. The result will have to be
  * freed by the caller. It also supports being passed a NULL which results in the same