From: Bob Dunlop Date: Sun, 19 Aug 2007 09:26:13 +0000 (-0400) Subject: ntpdc_ops.c, ChangeLog: X-Git-Tag: NTP_4_2_4P4_RC2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8b633aeee5f9dfb04097686e34cab567288b2683;p=thirdparty%2Fntp.git ntpdc_ops.c, ChangeLog: [BUG 881] Corrected display of pll offset on 64bit systems. [BUG 886] Corrected sign extension of il->compliance on 64 bit systems [BUG 878] Avoid ntpdc use of refid value as unterminated string. bk: 46c80cb5SYY_gsCE9EezPujxLGJPUg --- diff --git a/ChangeLog b/ChangeLog index acb8d3613..2aef2ca1a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +* [Bug 878] Avoid ntpdc use of refid value as unterminated string. +* [Bug 881] Corrected display of pll offset on 64bit systems. +* [Bug 886] Corrected sign handling on 64bit in ntpdc loopinfo command. * [Bug 889] avoid malloc() interrupted by SIGIO risk * ntpd/refclock_parse.c: cleanup shutdown while the file descriptor is still open. * [Bug 885] use emalloc() to get a message at the end of the memory diff --git a/ntpdc/ntpdc_ops.c b/ntpdc/ntpdc_ops.c index 20bee3a41..8d6a23c59 100644 --- a/ntpdc/ntpdc_ops.c +++ b/ntpdc/ntpdc_ops.c @@ -886,7 +886,7 @@ again: "offset %s, frequency %s, time_const %ld, watchdog %ld\n", lfptoa(&tempts, 6), lfptoa(&temp2ts, 3), - (u_long)ntohl((u_long)il->compliance), + (long)(int32_t)ntohl((u_long)il->compliance), (u_long)ntohl((u_long)il->watchdog_timer)); } else { NTOHL_FP(&il->last_offset, &tempts); @@ -896,7 +896,7 @@ again: (void) fprintf(fp, "frequency: %s ppm\n", lfptoa(&tempts, 3)); (void) fprintf(fp, "poll adjust: %ld\n", - (u_long)ntohl(il->compliance)); + (long)(int32_t)ntohl(il->compliance)); (void) fprintf(fp, "watchdog timer: %ld s\n", (u_long)ntohl(il->watchdog_timer)); } @@ -2700,7 +2700,6 @@ clockstat( int res; l_fp ts; struct clktype *clk; - u_long ltemp; for (qitems = 0; qitems < min(pcmd->nargs, 8); qitems++) clist[qitems] = GET_INADDR(pcmd->argval[qitems].netnum); @@ -2758,9 +2757,8 @@ again: lfptoa(&ts, 6)); (void) fprintf(fp, "stratum: %ld\n", (u_long)ntohl(cl->fudgeval1)); - ltemp = ntohl(cl->fudgeval2); (void) fprintf(fp, "reference ID: %s\n", - (char *)<emp); + refid_string(ntohl(cl->fudgeval2), 0)); (void) fprintf(fp, "fudge flags: 0x%x\n", cl->flags); @@ -2992,7 +2990,7 @@ again: tscale = 1e-9; #endif (void)fprintf(fp, "pll offset: %g s\n", - (long)ntohl(ik->offset) * tscale); + (int32_t)ntohl(ik->offset) * tscale); (void)fprintf(fp, "pll frequency: %s ppm\n", fptoa((s_fp)ntohl(ik->freq), 3)); (void)fprintf(fp, "maximum error: %g s\n",