summaryrefslogtreecommitdiff
path: root/src/misc.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2010-09-10 20:31:31 -0400
committerAdam <Adam@anope.org>2010-09-10 20:31:31 -0400
commitf00e76d30a86acf0f18bcde5647eedd50de50569 (patch)
tree04af81a883ea6e71ec36e35a2822487c7f8192c6 /src/misc.cpp
parent9eb7562bee7f2a52cf91b0ab0ebc10351f2a46f2 (diff)
Added Anope::CurTime to keep us from calling time() everywhere
Diffstat (limited to 'src/misc.cpp')
-rw-r--r--src/misc.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/misc.cpp b/src/misc.cpp
index d77ed4d91..225aac592 100644
--- a/src/misc.cpp
+++ b/src/misc.cpp
@@ -354,17 +354,15 @@ Anope::string duration(const NickCore *nc, time_t seconds)
*/
Anope::string expire_left(const NickCore *nc, time_t expires)
{
- time_t now = time(NULL);
-
char buf[256];
if (!expires)
strlcpy(buf, getstring(nc, NO_EXPIRE), sizeof(buf));
- else if (expires <= now)
+ else if (expires <= Anope::CurTime)
strlcpy(buf, getstring(nc, EXPIRES_SOON), sizeof(buf));
else
{
- time_t diff = expires - now + 59;
+ time_t diff = expires - Anope::CurTime + 59;
if (diff >= 86400)
{