From ac4876718f268326f34ad4fc58a9811f7a869949 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Tue, 11 Feb 2020 04:00:25 -0500 Subject: Fix whois idle unit calculation Rookie mistake. --- handle.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'handle.c') diff --git a/handle.c b/handle.c index ce56a51..f76a181 100644 --- a/handle.c +++ b/handle.c @@ -407,9 +407,15 @@ static void handleReplyWhoisIdle(struct Message *msg) { if (!replies.whois) return; unsigned long idle = strtoul(msg->params[2], NULL, 10); const char *unit = "second"; - if (idle / 60) { idle /= 60; unit = "minute"; } - if (idle / 60) { idle /= 60; unit = "hour"; } - if (idle / 24) { idle /= 24; unit = "day"; } + if (idle / 60) { + idle /= 60; unit = "minute"; + if (idle / 60) { + idle /= 60; unit = "hour"; + if (idle / 24) { + idle /= 24; unit = "day"; + } + } + } time_t signon = (msg->params[3] ? strtoul(msg->params[3], NULL, 10) : 0); uiFormat( Network, Warm, tagTime(msg), -- cgit 1.4.1