From: Harlan Stenn Date: Sun, 4 May 2014 04:51:37 +0000 (+0000) Subject: nits X-Git-Tag: NTP_4_2_7P441~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4bf68fa89c22b6342586320e92ff5f888a37f9e8;p=thirdparty%2Fntp.git nits bk: 5365c759BM8rAHkjRvLzc_nyPHBjBA --- diff --git a/ntpd/ntp_leapsec.c b/ntpd/ntp_leapsec.c index d85c75e43..9fe24cf33 100644 --- a/ntpd/ntp_leapsec.c +++ b/ntpd/ntp_leapsec.c @@ -456,7 +456,7 @@ leapsec_load_file( int rc; /* just do nothing if there is no leap file */ - if ( ! (fname && *fname)) + if ( !(fname && *fname) ) return FALSE; /* try to stat the leapfile */ @@ -468,9 +468,10 @@ leapsec_load_file( /* silently skip to postcheck if no new file found */ if (NULL != sb_old) { - if (!force && - sb_old->st_mtime == sb_new.st_mtime && - sb_old->st_ctime == sb_new.st_ctime ) + if (!force + && sb_old->st_mtime == sb_new.st_mtime + && sb_old->st_ctime == sb_new.st_ctime + ) return FALSE; *sb_old = sb_new; } @@ -574,8 +575,8 @@ leapsec_add_dyn( pt = leapsec_get_table(TRUE); now64 = ntpcal_ntp_to_ntp(ntpnow, pivot); - return leapsec_add(pt, &now64, (insert != 0)) - && leapsec_set_table(pt); + return ( leapsec_add(pt, &now64, (insert != 0)) + && leapsec_set_table(pt)); } /* ===================================================================== @@ -774,7 +775,7 @@ leapsec_add( * the extend the table beyond the expiration! */ if ( ucmpv64(now64, &pt->head.expire) < 0 - || (pt->head.size && ucmpv64(now64, &pt->info[0].ttime) <= 0)) { + || (pt->head.size && ucmpv64(now64, &pt->info[0].ttime) <= 0)) { errno = ERANGE; return FALSE; } @@ -853,6 +854,7 @@ betweenu32( uint32_t hi) { int rc; + if (lo <= hi) rc = (lo <= x) && (x < hi); else diff --git a/ntpd/ntp_util.c b/ntpd/ntp_util.c index 76a2239d9..b522931dc 100644 --- a/ntpd/ntp_util.c +++ b/ntpd/ntp_util.c @@ -898,8 +898,8 @@ check_leap_file( logPrefix, leapfile_name, -rc); else msyslog(LOG_WARNING, - "%s ('%s'): will expire in less than %d days", - logPrefix, leapfile_name, 1+rc); + "%s ('%s'): will expire in less than %d day%s", + logPrefix, leapfile_name, 1+rc, (rc) ? "s" : ""); } }