aboutsummaryrefslogtreecommitdiff
path: root/src/server/worldserver/CommandLine
diff options
context:
space:
mode:
authorTreeston <treeston.mmoc@gmail.com>2020-09-12 19:42:10 +0200
committerGitHub <noreply@github.com>2020-09-12 19:42:10 +0200
commit75f9e7396e35360f3016cc0cb21e72e20f5d96d5 (patch)
treee738b70d54516717d2c784117fbd2b0134412ac0 /src/server/worldserver/CommandLine
parent59be657ca267667b3cbeb1f34d47df0382e97f53 (diff)
[3.3.5] Core/ChatCommands: Show error messages from argument parsers (PR #25443)
Diffstat (limited to 'src/server/worldserver/CommandLine')
-rw-r--r--src/server/worldserver/CommandLine/CliRunnable.cpp11
1 files changed, 5 insertions, 6 deletions
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