diff options
author | Sadie Powell <sadie@witchery.services> | 2025-05-24 16:51:33 +0100 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2025-05-24 16:54:49 +0100 |
commit | 23e72fc934eae5a5fadde21102ec342840956c1f (patch) | |
tree | 3e53a265383c88777badf9a9328774be80c77645 /src | |
parent | e182519e4d2f35c9fed070c9fb5004276c865070 (diff) |
Convert Anope::Debug to an unsigned value.
Diffstat (limited to 'src')
-rw-r--r-- | src/init.cpp | 7 | ||||
-rw-r--r-- | src/main.cpp | 2 |
2 files changed, 4 insertions, 5 deletions
diff --git a/src/init.cpp b/src/init.cpp index 89a946a98..282ec8957 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -390,11 +390,10 @@ bool Anope::Init(int ac, char **av) { if (!arg.empty()) { - auto level = Anope::Convert<int>(arg, -1); - if (level > 0) - Anope::Debug = level; - else + auto level = Anope::TryConvert<unsigned>(arg); + if (!level.has_value()) throw CoreException("Invalid option given to --debug"); + Anope::Debug = level.value(); } else ++Anope::Debug; diff --git a/src/main.cpp b/src/main.cpp index 283d7146e..fcb3efe89 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -23,7 +23,7 @@ #endif /* Command-line options: */ -int Anope::Debug = 0; +unsigned Anope::Debug = 0; bool Anope::ReadOnly = false, Anope::NoFork = false, Anope::NoThird = false, Anope::NoPID = false, Anope::NoExpire = false, Anope::ProtocolDebug = false; Anope::string Anope::ServicesDir; Anope::string Anope::ServicesBin; |