summaryrefslogtreecommitdiff
path: root/lib/String.cc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/String.cc')
-rw-r--r--lib/String.cc13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/String.cc b/lib/String.cc
index 82b0e00..04fca01 100644
--- a/lib/String.cc
+++ b/lib/String.cc
@@ -137,10 +137,21 @@ const char * String::set(const char * s, va_list ap) {
#else // !HAVE_VASPRINTF
#ifdef HAVE_VSNPRINTF
vsnprintf(t, BUFSIZ, s, ap);
+ str = Base::strdup(r = t);
#else // !HAVE_VSNPRINTF
+#ifdef _WIN32
+#ifdef _MSC_VER
+ r = str = (char *) malloc(_vscprintf(s, ap) + 1);
+ vsprintf(str, s, ap);
+#else
+ _vsnprintf(t, BUFSIZ, s, ap);
+ str = Base::strdup(r = t);
+#endif
+#else
vsprintf(t, s, ap);
-#endif // HAVE_VSNPRINTF
str = Base::strdup(r = t);
+#endif
+#endif // HAVE_VSNPRINTF
#endif // HAVE_VASPRINTF
#endif // HAVE_GMP
siz = ::strlen(str);