]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
cleanups
authorHarlan Stenn <stenn@ntp.org>
Sun, 16 Apr 2023 08:27:34 +0000 (03:27 -0500)
committerHarlan Stenn <stenn@ntp.org>
Sun, 16 Apr 2023 08:27:34 +0000 (03:27 -0500)
bk: 643bb1763LUrbj17nSymVbLpnwuI1g

ChangeLog
libntp/mstolfp.c
libntp/systime.c

index a72d2ae3af7e9465a093efa6c28cd7ea7bb08cea..20ea4201737f4e16b42bc4be0cb4e63bb4ed2fdf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,8 @@
-* [Bug 3806] libntp/mstolfp.c needs bounds checking <perlinger@ntp.org>
-  - solved numerically instead of using string manipulation
 ---
 * [Sec 3807] praecis_parse() in the Palisade refclock driver has a
              hypothetical input buffer overflow. Reported by ... stenn@
+* [Sec 3806] libntp/mstolfp.c needs bounds checking <perlinger@ntp.org>
+  - solved numerically instead of using string manipulation
 * [Bug 3802] ntp-keygen -I default identity modulus bits too small for
              OpenSSL 3.  Reported by rmsh1216@163.com <hart@ntp.org>
 * [Bug 3801] gpsdjson refclock gps_open() device name mishandled. <hart@ntp.org>
@@ -79,7 +79,8 @@
              Integrated patch from Brian Utterback. <hart@ntp.org>
 * [Bug 2525] Turn on automake subdir-objects across the project. <hart@ntp.org>
 * [Bug 2410] syslog an error message on panic exceeded. <brian.utterback@oracle.com>
-* Use recv_buffer instead of the longer recv_space.X_recv_buffer.
+* Only define tv_fmt_libbuf() if we will use it. <stenn@ntp.org>
+* Use recv_buffer instead of the longer recv_space.X_recv_buffer. hart/stenn
 * Disable "embedded NUL in string" warnings in libopts, when we can. <stenn@>
 * Use https in the AC_INIT URLs in configure.ac.  <stenn@ntp.org>
 * Implement NTP_FUNC_REALPATH.  <stenn@ntp.org>
index daf24a76838e65773b5bdeb3d9fada85c44f3e8e..c82b7f5909bfb5899bb640f9343fe6d05b70c502 100644 (file)
@@ -35,9 +35,9 @@ mstolfp(
                ++str;
        
        switch (ch) {
-       case '-': neg = TRUE;
-       case '+': ++str;
-       default : break;
+           case '-': neg = TRUE;
+           case '+': ++str;
+           default : break;
        }
        
        if (!isdigit(ch = *(const unsigned char*)str) && (ch != '.'))
@@ -67,6 +67,7 @@ mstolfp(
         * messy to fix in the unit tests. So we stay with the slightly
         * suboptimal calculation...)
         */
+       /* round */
        if (r >= 500)
                L_ADDUF(lfp, 1u);
        /* fix sign */
index e2f07f71aa924d2f0e86e77332bffe8d4bf09218..f2d144d3cbf4666113eabdbe84048bb186708752 100644 (file)
@@ -591,6 +591,8 @@ step_systime(
        return TRUE;
 }
 
+
+#if SIZEOF_TIME_T > 4
 static const char *
 tv_fmt_libbuf(
        const struct timeval * ptv
@@ -612,6 +614,7 @@ tv_fmt_libbuf(
                 (u_int)ptv->tv_usec);
        return retv;
 }
+#endif
 
 
 int /*BOOL*/