summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/BString.cc6
1 files 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 {