[Git][NTPsec/ntpsec][master] Fix leap smear bug and clang warnings.

Hal Murray (@hal.murray) gitlab at mg.gitlab.com
Thu Dec 22 05:43:35 UTC 2022



Hal Murray pushed to branch master at NTPsec / ntpsec


Commits:
4de69747 by Hal Murray at 2022-12-21T20:43:12-08:00
Fix leap smear bug and clang warnings.

- - - - -


2 changed files:

- attic/random.c
- ntpd/ntp_proto.c


Changes:

=====================================
attic/random.c
=====================================
@@ -77,6 +77,7 @@ static int do_average(void) {
 		sum += random();
 	}
 	clock_gettime(CLOCK_REALTIME, &stop);
+	(void)sum;	/* Squash unused warning */
 
 	/* Beware of overflowing 32 bits. */
 	sec = (stop.tv_sec-start.tv_sec);
@@ -164,7 +165,7 @@ static int do_fastest(void) {
 			fastest = nanos;
 		}
 	}
-
+	(void)sum;	/* Squash unused warning */
 	return fastest;
 }
 


=====================================
ntpd/ntp_proto.c
=====================================
@@ -2187,7 +2187,7 @@ peer_xmit(
 
 static void
 leap_smear_add_offs(l_fp *t) {
-	t += leap_smear.offset;
+	*t += leap_smear.offset;
 }
 
 #endif	/* ENABLE_LEAP_SMEAR */



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/commit/4de6974777668eb68d443da011d0a6aff8ed1267

-- 
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/commit/4de6974777668eb68d443da011d0a6aff8ed1267
You're receiving this email because of your account on gitlab.com.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20221222/9671f7f8/attachment-0001.htm>


More information about the vc mailing list