summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2011-09-15 02:30:09 +0200
committerGravatar Martin Szulecki2012-03-19 01:43:52 +0100
commit7677cd4a5290b6b90f09825cdb5e2945ad276dab (patch)
tree582493565da2776b901ca6aae5f8c524dd1522cd
parent7acb8ecfd05353388d22f7a548dc15bc4134b8a3 (diff)
downloadlibimobiledevice-7677cd4a5290b6b90f09825cdb5e2945ad276dab.tar.gz
libimobiledevice-7677cd4a5290b6b90f09825cdb5e2945ad276dab.tar.bz2
win32: fix vasprintf
-rw-r--r--include/asprintf.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/asprintf.h b/include/asprintf.h
index 3b0072e..65957e0 100644
--- a/include/asprintf.h
+++ b/include/asprintf.h
@@ -9,10 +9,11 @@
static inline int vasprintf(char **PTR, const char *TEMPLATE, va_list AP)
{
int res;
- res = vsnprintf(NULL, 32768, TEMPLATE, AP);
+ char buf[16];
+ res = vsnprintf(buf, 16, TEMPLATE, AP);
if (res > 0) {
*PTR = (char*)malloc(res+1);
- res = vsnprintf(*PTR, res, TEMPLATE, AP);
+ res = vsnprintf(*PTR, res+1, TEMPLATE, AP);
}
return res;
}