aboutsummaryrefslogtreecommitdiffstats
path: root/com32/lib/asprintf.c
diff options
context:
space:
mode:
Diffstat (limited to 'com32/lib/asprintf.c')
-rw-r--r--com32/lib/asprintf.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/com32/lib/asprintf.c b/com32/lib/asprintf.c
index ef5b4b2f..eab20118 100644
--- a/com32/lib/asprintf.c
+++ b/com32/lib/asprintf.c
@@ -21,9 +21,10 @@ int asprintf(char **bufp, const char *format, ...)
*bufp = p = malloc(bytes);
if (!p)
- return -1;
+ rv = -1;
+ else
+ rv = vsnprintf(p, bytes, format, ap);
- rv = vsnprintf(p, bytes, format, ap);
va_end(ap);
return rv;