diff options
author | megamage <none@none> | 2009-08-19 17:14:18 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-08-19 17:14:18 -0500 |
commit | 34a95e7fa882f702e50305b9bc726d5b86c7e63b (patch) | |
tree | 2ad0c1e9e29b1224abe28d2f9e91766fa7eaa3dd /src/shared/Util.cpp | |
parent | c9117721255b24d86f00b3f94c6f112fefa5bfdd (diff) |
[8390] Fixed log output work after recent replace UTF8PRINT macro. Author: VladimirMangos
--HG--
branch : trunk
Diffstat (limited to 'src/shared/Util.cpp')
-rw-r--r-- | src/shared/Util.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/shared/Util.cpp b/src/shared/Util.cpp index 3d3b205209a..5b52857f55a 100644 --- a/src/shared/Util.cpp +++ b/src/shared/Util.cpp @@ -481,25 +481,25 @@ bool Utf8FitTo(const std::string& str, std::wstring search) void utf8printf(FILE *out, const char *str, ...) { va_list ap; + va_start(ap, str); + vutf8printf(stdout, str, &ap); + va_end(ap); +} +void vutf8printf(FILE *out, const char *str, va_list* ap) +{ #if PLATFORM == PLATFORM_WINDOWS char temp_buf[32*1024]; wchar_t wtemp_buf[32*1024]; - size_t temp_len; - size_t wtemp_len; - va_start(ap, str); - temp_len = vsnprintf(temp_buf, 32*1024, str, ap); - va_end(ap); + size_t temp_len = vsnprintf(temp_buf, 32*1024, str, *ap); - wtemp_len = 32*1024-1; + size_t wtemp_len = 32*1024-1; Utf8toWStr(temp_buf, temp_len, wtemp_buf, wtemp_len); CharToOemBuffW(&wtemp_buf[0], &temp_buf[0], wtemp_len+1); fprintf(out, temp_buf); #else - va_start(ap, str); - vfprintf(out, str, ap); - va_end(ap); + vfprintf(out, str, *ap); #endif } |