summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/init.cpp7
-rw-r--r--src/main.cpp2
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;