From 34bf21f7d199e3c744ca7a38f2ebd81cbbdaa2ec Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 16 Jan 2017 18:42:29 -0500 Subject: Correct a couple expiry time checks from DoTime() --- modules/commands/bs_set.cpp | 2 +- modules/commands/cs_ban.cpp | 2 +- modules/commands/cs_suspend.cpp | 2 +- modules/commands/ns_suspend.cpp | 2 +- modules/commands/os_forbid.cpp | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/commands/bs_set.cpp b/modules/commands/bs_set.cpp index 70b399b08..eeb7cf7c5 100644 --- a/modules/commands/bs_set.cpp +++ b/modules/commands/bs_set.cpp @@ -114,7 +114,7 @@ class CommandBSSetBanExpire : public Command } time_t t = Anope::DoTime(arg); - if (t == -1) + if (t < 0) { source.Reply(BAD_EXPIRY_TIME); return; diff --git a/modules/commands/cs_ban.cpp b/modules/commands/cs_ban.cpp index 9716bfd37..0b410789e 100644 --- a/modules/commands/cs_ban.cpp +++ b/modules/commands/cs_ban.cpp @@ -70,7 +70,7 @@ class CommandCSBan : public Command if (params[1][0] == '+') { ban_time = Anope::DoTime(params[1]); - if (ban_time == -1) + if (ban_time < 0) { source.Reply(BAD_EXPIRY_TIME); return; diff --git a/modules/commands/cs_suspend.cpp b/modules/commands/cs_suspend.cpp index 71f6f1536..87df57610 100644 --- a/modules/commands/cs_suspend.cpp +++ b/modules/commands/cs_suspend.cpp @@ -75,7 +75,7 @@ class CommandCSSuspend : public Command else { expiry_secs = Anope::DoTime(expiry); - if (expiry_secs == -1) + if (expiry_secs < 0) { source.Reply(BAD_EXPIRY_TIME); return; diff --git a/modules/commands/ns_suspend.cpp b/modules/commands/ns_suspend.cpp index 3be8458c8..a5eef8665 100644 --- a/modules/commands/ns_suspend.cpp +++ b/modules/commands/ns_suspend.cpp @@ -81,7 +81,7 @@ class CommandNSSuspend : public Command else { expiry_secs = Anope::DoTime(expiry); - if (expiry_secs == -1) + if (expiry_secs < 0) { source.Reply(BAD_EXPIRY_TIME); return; diff --git a/modules/commands/os_forbid.cpp b/modules/commands/os_forbid.cpp index 6b8c6c03d..0d4426839 100644 --- a/modules/commands/os_forbid.cpp +++ b/modules/commands/os_forbid.cpp @@ -187,7 +187,7 @@ class CommandOSForbid : public Command if (!expiry.empty()) { expiryt = Anope::DoTime(expiry); - if (expiryt == -1) + if (expiryt < 0) { source.Reply(BAD_EXPIRY_TIME); return; -- cgit