diff options
author | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2013-12-24 07:45:39 +0100 |
---|---|---|
committer | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2013-12-24 07:45:39 +0100 |
commit | c60645d3effc7ec04b4e7a413e0a2b552e3fa90e (patch) | |
tree | 150216073ce542817721d6ea20aa6e1d32b848aa /src/BString.cc | |
parent | d2938865f2421e160adc18e86dd7813278035c70 (diff) | |
parent | 61202b565e7c440cae443d71f78b6c506ab60f38 (diff) |
Merge branch 'master' of /pub/repo.git/Balau
Diffstat (limited to 'src/BString.cc')
-rw-r--r-- | src/BString.cc | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/BString.cc b/src/BString.cc index 57febcd..d14280c 100644 --- a/src/BString.cc +++ b/src/BString.cc @@ -22,6 +22,24 @@ Balau::String & Balau::String::set(const char * fmt, va_list ap) { return *this; } +Balau::String & Balau::String::append(const char * fmt, va_list ap) { + unsigned int l; +#ifdef _WIN32 + // Microsoft is stupid. + char tt[65536]; + l = _vsnprintf(tt, sizeof(tt)-1, fmt, ap); + tt[65535] = 0; + std::string::append(tt, l); +#else + char * t; + l = vasprintf(&t, fmt, ap); + std::string::append(t, l); + free(t); +#endif + + return *this; +} + int Balau::String::strchrcnt(char c) const { unsigned int l = length(); int r = 0; |