-/* $Id: test-vasprintf.c,v 1.1 2015/03/19 14:57:29 schwarze Exp $ */
+/* $Id: test-vasprintf.c,v 1.5 2018/08/15 02:15:52 schwarze Exp $ */
/*
* Copyright (c) 2015 Ingo Schwarze <schwarze@openbsd.org>
*
#include <stdio.h>
#include <string.h>
-int
+static int testfunc(char **, const char *, ...);
+
+
+static int
testfunc(char **ret, const char *format, ...)
{
va_list ap;
irc = vasprintf(ret, format, ap);
va_end(ap);
- return(irc);
+ return irc;
}
int
char *ret;
if (testfunc(&ret, "%s.", "Text") != 5)
- return(1);
+ return 1;
if (strcmp(ret, "Text."))
- return(2);
- return(0);
+ return 2;
+ return 0;
}