summaryrefslogtreecommitdiff
path: root/src/who.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/who.c')
-rw-r--r--src/who.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/who.c b/src/who.c
index f56c71833..d5f573255 100644
--- a/src/who.c
+++ b/src/who.c
@@ -26,6 +26,7 @@
#include <config.h>
#include <getopt.h>
#include <stdio.h>
+#include <assert.h>
#include <sys/types.h>
#include "system.h"
@@ -198,6 +199,9 @@ idle_string (time_t when, time_t boottime)
else
{
static char idle_hhmm[IDLESTR_LEN];
+ /* FIXME-in-2018: see if this assert is still required in order
+ to suppress gcc's unwarranted -Wformat-length= warning. */
+ assert (seconds_idle / (60 * 60) < 24);
sprintf (idle_hhmm, "%02d:%02d",
seconds_idle / (60 * 60),
(seconds_idle % (60 * 60)) / 60);