Skip to content

Commit d1ae252

Browse files
simplify using SString trim
1 parent 4a0bc7e commit d1ae252

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

Server/mods/deathmatch/logic/CMainConfig.cpp

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -133,17 +133,8 @@ bool CMainConfig::Load()
133133
return false;
134134
}
135135

136-
// Cancel if the server name only contains spaces
137-
const std::size_t snameStart = m_strServerName.find_first_not_of(" ");
138-
if (snameStart == std::string::npos)
139-
{
140-
CLogger::ErrorPrintf("Server name must contain at least one character other than a space\n");
141-
return false;
142-
}
143-
144136
// Strip spaces from beginning and end of server name
145-
const std::size_t snameEnd = m_strServerName.find_last_not_of(" ");
146-
m_strServerName = m_strServerName.substr(snameStart, snameEnd - snameStart + 1);
137+
m_strServerName = SString(m_strServerName).TrimStart(" ").TrimEnd(" ");
147138

148139
// Grab the forced server ip(s)
149140
GetString(m_pRootNode, "serverip", m_strServerIP);

0 commit comments

Comments
 (0)