]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 3475] modify prettydate() to suppress output of zero time
authorJuergen Perlinger <perlinger@ntp.org>
Wed, 11 Apr 2018 16:38:12 +0000 (18:38 +0200)
committerJuergen Perlinger <perlinger@ntp.org>
Wed, 11 Apr 2018 16:38:12 +0000 (18:38 +0200)
bk: 5ace39f4QC-YkCwCq6NfDQDS0aXtGA

ChangeLog
libntp/prettydate.c

index ef56ecc5c7ed1145d4c20eea9d674af866186b7a..45a670849009b8df36bca29012044da83256e690 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -10,6 +10,8 @@
   - applied patch by Gerry Garvey (with mods)
 * [Bug 3476]ctl_putstr() sends empty unquoted string [...] <perlinger@ntp.org>
   - 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 <perlinger@ntp.org>
+  - applied patch by Gerry Garvey
 * [Bug 3474] Missing pmode in mode7 peer info response <perlinger@ntp.org>
   - applied patch by Gerry Garvey
 * [Bug 3471] Check for openssl/[ch]mac.h.  HStenn.
index 25b085ef28fb0ee857177a29b64dab12fed3068e..deacc26bbe2bfcac4cb450bb673a6bfebd263979 100644 (file)
@@ -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) */