aboutsummaryrefslogtreecommitdiff
path: root/libntp/prettydate.c
diff options
context:
space:
mode:
Diffstat (limited to 'libntp/prettydate.c')
-rw-r--r--libntp/prettydate.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libntp/prettydate.c b/libntp/prettydate.c
index 25b085ef28fb..deacc26bbe2b 100644
--- a/libntp/prettydate.c
+++ b/libntp/prettydate.c
@@ -170,6 +170,11 @@ common_prettydate(
LIB_GETBUF(bp);
+ if (ts->l_ui == 0 && ts->l_uf == 0) {
+ strlcpy (bp, "(no time)", LIB_BUFLENGTH);
+ return (bp);
+ }
+
/* get & fix milliseconds */
ntps = ts->l_ui;
msec = ts->l_uf / 4294967; /* fract / (2 ** 32 / 1000) */