aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Commands
diff options
context:
space:
mode:
authorGiacomo Pozzoni <giacomopoz@gmail.com>2020-07-31 20:53:13 +0000
committerGitHub <noreply@github.com>2020-07-31 22:53:13 +0200
commit7cf122fc2a604bae77d0b935536c41ec9203e62d (patch)
tree029e18afdceae5ebab686103ee9050a6c6727688 /src/server/scripts/Commands
parent5b863acf9285d675a61819d939f38297f49d5c92 (diff)
Core/Misc: Fix static analysis issues (#25178)
Diffstat (limited to 'src/server/scripts/Commands')
-rw-r--r--src/server/scripts/Commands/cs_server.cpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/server/scripts/Commands/cs_server.cpp b/src/server/scripts/Commands/cs_server.cpp
index 1bcff8d97f5..e4c95cb18b3 100644
--- a/src/server/scripts/Commands/cs_server.cpp
+++ b/src/server/scripts/Commands/cs_server.cpp
@@ -422,19 +422,12 @@ public:
}
// Set the level of logging
- static bool HandleServerSetLogLevelCommand(ChatHandler* /*handler*/, char const* args)
+ static bool HandleServerSetLogLevelCommand(ChatHandler* /*handler*/, std::string const& type, std::string const& name, int32 level)
{
- if (!*args)
- return false;
-
- char* type = strtok((char*)args, " ");
- char* name = strtok(nullptr, " ");
- char* level = strtok(nullptr, " ");
-
- if (!type || !name || !level || *name == '\0' || *level == '\0' || (*type != 'a' && *type != 'l'))
+ if (name.empty() || level < 0 || (type != "a" && type != "l"))
return false;
- sLog->SetLogLevel(name, level, *type == 'l');
+ sLog->SetLogLevel(name, level, type == "l");
return true;
}