Skip to content

Commit

Permalink
Fix a typo from 2000 BC
Browse files Browse the repository at this point in the history
  • Loading branch information
Louvenarde committed Feb 3, 2024
1 parent 14b52db commit 0218ff6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
11 changes: 2 additions & 9 deletions src/Components/Modules/ServerList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -623,17 +623,10 @@ namespace Components
std::hash<ServerInfo> hashFn;
server.hash = hashFn(server);

#if false
// more secure
server.hostname = TextRenderer::StripMaterialTextIcons(server.hostname);
#else
// more fun !
constexpr auto MAX_SERVER_NAME_LENGTH = 48;
server.hostname = server.hostname.substr(0, MAX_SERVER_NAME_LENGTH);

#endif
const auto strippedHostName = TextRenderer::StripMaterialTextIcons(server.hostname);
if (server.hostname.empty() || strippedHostName.empty() || std::all_of(strippedHostName.begin(), strippedHostName.end(), isspace))

if (server.hostname.empty() || std::all_of(server.hostname.begin(), server.hostname.end(), isspace))
{
// Invalid server name containing only emojis
return;
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Modules/TextRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1414,7 +1414,7 @@ namespace Components
std::string TextRenderer::StripMaterialTextIcons(const std::string& in)
{
char buffer[1000]{}; // Should be more than enough
StripAllTextIcons(in.data(), buffer, sizeof(buffer));
StripMaterialTextIcons(in.data(), buffer, sizeof(buffer));
return std::string{ buffer };
}

Expand Down

0 comments on commit 0218ff6

Please sign in to comment.