* [Bug 3485] Undefined sockaddr used in error messages in ntp_config.c <perlinger@ntp.org>
- applied patch by Gerry Garvey
+* [Bug 3482] Fixes for compilation warnings (ntp_io.c & ntpq-subs.c) <perlinger@ntp.org>
+ - applied patch by Gerry Garvey (with mods)
* [Bug 3480] Refclock sample filter not cleared on clock STEP <perlinger@ntp.org>
- applied patch by Gerry Garvey
* [Bug 3479] ctl_putrefid() allows unsafe characters through to ntpq <perlinger@ntp.org>
}
if (diff <= 2048) {
- snprintf(buf, cb, "%ld", diff);
+ snprintf(buf, cb, "%u", (unsigned int)diff);
return buf;
}
diff = (diff + 29) / 60;
if (diff <= 300) {
- snprintf(buf, cb, "%ldm", diff);
+ snprintf(buf, cb, "%um", (unsigned int)diff);
return buf;
}
diff = (diff + 29) / 60;
if (diff <= 96) {
- snprintf(buf, cb, "%ldh", diff);
+ snprintf(buf, cb, "%uh", (unsigned int)diff);
return buf;
}
diff = (diff + 11) / 24;
if (diff <= 999) {
- snprintf(buf, cb, "%ldd", diff);
+ snprintf(buf, cb, "%ud", (unsigned int)diff);
return buf;
}
/* years are only approximated... */
diff = (long)floor(diff / 365.25 + 0.5);
- snprintf(buf, cb, "%ldy", diff);
+ if (diff <= 999) {
+ snprintf(buf, cb, "%uy", (unsigned int)diff);
+ return buf;
+ }
+ /* Ok, this amounts to infinity... */
+ strlcpy(buf, "INF", cb);
return buf;
}
l_fp ts;
u_long poll_sec;
char type = '?';
- char whenbuf[8], pollbuf[8];
char clock_name[LENHOSTNAME];
-
+ char whenbuf[12], pollbuf[12];
+ /* [Bug 3482] formally whenbuf & pollbuf should be able to hold
+ * a full signed int. Not that we would use that much string
+ * data for it...
+ */
get_systime(&ts);
have_srchost = FALSE;