]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Fix [CID 72], a typo introduced at the latest fix to prettydate.c
authorHarlan Stenn <stenn@ntp.org>
Fri, 30 Jan 2009 08:47:58 +0000 (03:47 -0500)
committerHarlan Stenn <stenn@ntp.org>
Fri, 30 Jan 2009 08:47:58 +0000 (03:47 -0500)
bk: 4982bebeImq6FWvBAnrHB5UOWmd9FQ

ChangeLog
libntp/prettydate.c

index b1f40476b96f45bf8144d918d5fea238944b8841..4a2e266df852309d6c1bbc46115758ffb914b27e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,4 @@
+* Fix [CID 72], a typo introduced at the latest fix to prettydate.c.
 (4.2.5p157) 2009/01/26 Released by Harlan Stenn <stenn@ntp.org>
 * Cleanup/fixes for ntp_proto.c and ntp_crypto.c from Dave Mills.
 (4.2.5p156) 2009/01/19 Released by Harlan Stenn <stenn@ntp.org>
index eb9789bc0338747f785180c6291d2cb6f49d626e..8ab1dbb0423731ed10a1986ab21da6d0a1d40e74 100644 (file)
@@ -126,7 +126,7 @@ ntp2unix_tm(
 #   endif /* Microsoft specific */
 
        /* 't' should be a suitable value by now. Just go ahead. */
-       while ( (tm = (*(local ? localtime : gmtime))(&t)) != 0)
+       while ( (tm = (*(local ? localtime : gmtime))(&t)) == 0)
                /* seems there are some other pathological implementations of
                ** 'gmtime()' and 'localtime()' somewhere out there. No matter
                ** if we have 32-bit or 64-bit 'time_t', try to fix this by
@@ -141,6 +141,7 @@ ntp2unix_tm(
                                return NULL; /* That's truely pathological! */
                }
        /* 'tm' surely not NULL here... */
+       NTP_INSIST(tm != NULL);
        if (folds != 0) {
                tm->tm_year += folds * SOLAR_CYCLE_YEARS;
                if (tm->tm_year <= 0 || tm->tm_year >= 200)