diff options
| author | Giacomo Pozzoni <giacomopoz@gmail.com> | 2020-07-31 20:53:13 +0000 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2022-01-24 20:21:25 +0100 |
| commit | 61bf51874de432856ecd2c5794334bd256d4b014 (patch) | |
| tree | 036fbac3f31f1a60730b265e3f991d5c7377d900 /src/server/scripts/Commands | |
| parent | a21fca5ddfad330401d631bfd01a2485576b4d22 (diff) | |
Core/Misc: Fix static analysis issues (#25178)
(cherry picked from commit 7cf122fc2a604bae77d0b935536c41ec9203e62d)
Diffstat (limited to 'src/server/scripts/Commands')
| -rw-r--r-- | src/server/scripts/Commands/cs_server.cpp | 13 |
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 67c31cd4e2a..d9cc9e3aa1f 100644 --- a/src/server/scripts/Commands/cs_server.cpp +++ b/src/server/scripts/Commands/cs_server.cpp @@ -426,19 +426,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; } |
