From: Juergen Perlinger Date: Wed, 11 Apr 2018 16:38:12 +0000 (+0200) Subject: [Bug 3475] modify prettydate() to suppress output of zero time X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ca385964d5f4340b99694490cfa1b86607889768;p=thirdparty%2Fntp.git [Bug 3475] modify prettydate() to suppress output of zero time bk: 5ace39f4QC-YkCwCq6NfDQDS0aXtGA --- diff --git a/ChangeLog b/ChangeLog index ef56ecc5c..45a670849 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,8 @@ - applied patch by Gerry Garvey (with mods) * [Bug 3476]ctl_putstr() sends empty unquoted string [...] - applied patch by Gerry Garvey (with mods); not sure if that's bug or feature, though +* [Bug 3475] modify prettydate() to suppress output of zero time + - applied patch by Gerry Garvey * [Bug 3474] Missing pmode in mode7 peer info response - applied patch by Gerry Garvey * [Bug 3471] Check for openssl/[ch]mac.h. HStenn. diff --git a/libntp/prettydate.c b/libntp/prettydate.c index 25b085ef2..deacc26bb 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) */