1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-17 01:12:39 +01:00

Codechange: pass the characters to trim to StrTrimView

This commit is contained in:
Rubidium
2025-05-03 08:05:54 +02:00
committed by rubidium42
parent e2db8277b8
commit 1f39d469ff
8 changed files with 16 additions and 11 deletions

View File

@@ -934,7 +934,7 @@ static bool ConClientNickChange(std::span<std::string_view> argv)
return true;
}
std::string client_name{StrTrimView(argv[2])};
std::string client_name{StrTrimView(argv[2], StringConsumer::WHITESPACE_NO_NEWLINE)};
if (!NetworkIsValidClientName(client_name)) {
IConsolePrint(CC_ERROR, "Cannot give a client an empty name.");
return true;