From 69401cf03ede9563b48904228b0d8801defd0c04 Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Tue, 4 Oct 2011 00:56:25 +0200 Subject: It's not because Microsoft is stupid by not having vasprintf that we need to be stupid too. --- src/BString.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/BString.cc b/src/BString.cc index 61abb8c..0b4b428 100644 --- a/src/BString.cc +++ b/src/BString.cc @@ -4,19 +4,19 @@ #include "BString.h" void Balau::String::set(const char * fmt, va_list ap) { - char * t; unsigned int l; #ifdef _WIN32 // Microsoft is stupid. char tt[65536]; l = _vsnprintf(tt, sizeof(tt) - 1, fmt, ap); tt[65535] = 0; - t = ::strdup(tt); + assign(tt, l); #else + char * t; l = vasprintf(&t, fmt, ap); -#endif assign(t, l); free(t); +#endif } int Balau::String::strchrcnt(char c) const { -- cgit v1.2.3