From: Harlan Stenn Date: Fri, 30 Jan 2009 08:47:58 +0000 (-0500) Subject: Fix [CID 72], a typo introduced at the latest fix to prettydate.c X-Git-Tag: NTP_4_2_5P158~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9d950adfb21073a6539f27482983e9d98e1b90f0;p=thirdparty%2Fntp.git Fix [CID 72], a typo introduced at the latest fix to prettydate.c bk: 4982bebeImq6FWvBAnrHB5UOWmd9FQ --- diff --git a/ChangeLog b/ChangeLog index b1f40476b..4a2e266df 100644 --- 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 * Cleanup/fixes for ntp_proto.c and ntp_crypto.c from Dave Mills. (4.2.5p156) 2009/01/19 Released by Harlan Stenn diff --git a/libntp/prettydate.c b/libntp/prettydate.c index eb9789bc0..8ab1dbb04 100644 --- a/libntp/prettydate.c +++ b/libntp/prettydate.c @@ -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)