From 75f9e7396e35360f3016cc0cb21e72e20f5d96d5 Mon Sep 17 00:00:00 2001 From: Treeston Date: Sat, 12 Sep 2020 19:42:10 +0200 Subject: [3.3.5] Core/ChatCommands: Show error messages from argument parsers (PR #25443) --- src/server/worldserver/CommandLine/CliRunnable.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/server/worldserver/CommandLine') diff --git a/src/server/worldserver/CommandLine/CliRunnable.cpp b/src/server/worldserver/CommandLine/CliRunnable.cpp index c71213761f2..57ea5916553 100644 --- a/src/server/worldserver/CommandLine/CliRunnable.cpp +++ b/src/server/worldserver/CommandLine/CliRunnable.cpp @@ -92,18 +92,17 @@ int cli_hook_func() #endif -void utf8print(void* /*arg*/, char const* str) +void utf8print(void* /*arg*/, std::string_view str) { #if TRINITY_PLATFORM == TRINITY_PLATFORM_WINDOWS - wchar_t wtemp_buf[6000]; - size_t wtemp_len = 6000-1; - if (!Utf8toWStr(str, strlen(str), wtemp_buf, wtemp_len)) + std::wstring wbuf; + if (!Utf8toWStr(str, wbuf)) return; - wprintf(L"%s", wtemp_buf); + wprintf(L"%s", wbuf.c_str()); #else { - printf("%s", str); + printf(STRING_VIEW_FMT, STRING_VIEW_FMT_ARG(str)); fflush(stdout); } #endif -- cgit v1.2.3