diff options
author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2015-04-07 08:29:34 +0000 |
---|---|---|
committer | <> | 2015-04-13 18:52:43 +0000 |
commit | b2ccf8dd31d1457ae9f0ae270054117179220370 (patch) | |
tree | 4ccd4a16d5e9ef5869630ba624e822665a6e248c /ntpd/ntp_leapsec.c | |
parent | bdab5265fcbf3f472545073a23f8999749a9f2b9 (diff) | |
download | ntp-b2ccf8dd31d1457ae9f0ae270054117179220370.tar.gz |
Imported from /home/lorry/working-area/delta_ntp/ntp-4.2.8p2.tar.gz.HEADntp-4.2.8p2master
Diffstat (limited to 'ntpd/ntp_leapsec.c')
-rw-r--r-- | ntpd/ntp_leapsec.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/ntpd/ntp_leapsec.c b/ntpd/ntp_leapsec.c index 14b8cd9..eeef89f 100644 --- a/ntpd/ntp_leapsec.c +++ b/ntpd/ntp_leapsec.c @@ -787,7 +787,7 @@ leapsec_add( const vint64 * now64 , int insert) { - vint64 ttime, stime; + vint64 ttime, starttime; struct calendar fts; leap_info_t li; @@ -815,12 +815,12 @@ leapsec_add( fts.hour = 0; fts.minute = 0; fts.second = 0; - stime = ntpcal_date_to_ntp64(&fts); + starttime = ntpcal_date_to_ntp64(&fts); fts.month++; ttime = ntpcal_date_to_ntp64(&fts); li.ttime = ttime; - li.stime = ttime.D_s.lo - stime.D_s.lo; + li.stime = ttime.D_s.lo - starttime.D_s.lo; li.taiof = (pt->head.size ? pt->info[0].taiof : pt->head.base_tai) + (insert ? 1 : -1); li.dynls = 1; @@ -839,7 +839,7 @@ leapsec_raw( int taiof, int dynls) { - vint64 stime; + vint64 starttime; struct calendar fts; leap_info_t li; @@ -856,9 +856,9 @@ leapsec_raw( return FALSE; } fts.month--; /* was in range 1..12, no overflow here! */ - stime = ntpcal_date_to_ntp64(&fts); + starttime = ntpcal_date_to_ntp64(&fts); li.ttime = *ttime; - li.stime = ttime->D_s.lo - stime.D_s.lo; + li.stime = ttime->D_s.lo - starttime.D_s.lo; li.taiof = (int16_t)taiof; li.dynls = (dynls != 0); return add_range(pt, &li); @@ -920,7 +920,8 @@ do_leap_hash( /* now do the byte twiddle */ for (wi=0; wi < 5; ++wi) for (di=3; di >= 0; --di) { - mac->hv[wi*4 + di] = (unsigned char)tmp[wi]; + mac->hv[wi*4 + di] = + (unsigned char)(tmp[wi] & 0x0FF); tmp[wi] >>= 8; } return TRUE; @@ -972,7 +973,7 @@ leapsec_validate( do_hash_data(&mdctx, line+2); else if (!strncmp(line, "#$", 2)) do_hash_data(&mdctx, line+2); - else if (isdigit(line[0])) + else if (isdigit((unsigned char)line[0])) do_hash_data(&mdctx, line); } isc_sha1_final(&mdctx, ldig.hv); |