[Git][NTPsec/ntpsec][master] Use C99 format string macros.

Eric S. Raymond gitlab at mg.gitlab.com
Sat Jan 23 17:28:51 UTC 2016


Eric S. Raymond pushed to branch master at NTPsec / ntpsec


Commits:
914583da by Matt Selsky at 2016-01-23T12:28:34-05:00
Use C99 format string macros.

- - - - -


1 changed file:

- ntpd/ntp_intercept.c


Changes:

=====================================
ntpd/ntp_intercept.c
=====================================
--- a/ntpd/ntp_intercept.c
+++ b/ntpd/ntp_intercept.c
@@ -90,6 +90,7 @@ Reference-clock events are not yet intercepted.
 #include <libgen.h>
 #include <sys/socket.h>
 #include <netdb.h>
+#include <inttypes.h>
 
 #include "ntpd.h"
 #include "ntp_io.h"
@@ -686,11 +687,7 @@ static char *lfpdump(l_fp *fp)
     np <<= FRACTION_PREC;
     np |= fp->l_uf;
 
-#if SIZEOF_LONG_LONG == SIZEOF_LONG
-    snprintf(buf, LIB_BUFLENGTH, "%lx", np);
-#else
-    snprintf(buf, LIB_BUFLENGTH, "%llx", np);
-#endif
+    snprintf(buf, LIB_BUFLENGTH, "%" PRIu64, np);
 
     return buf;
 }
@@ -699,11 +696,7 @@ static void lfpload(char *str, l_fp *fp)
 {
     uint64_t	np;
 
-#if SIZEOF_LONG_LONG == SIZEOF_LONG
-    sscanf(str, "%lx", &np);
-#else
-    sscanf(str, "%llx", &np);
-#endif
+    sscanf(str, "%" PRIu64, &np);
     
     (fp)->l_uf = (np) & 0xFFFFFFFF;					\
     (fp)->l_ui = (((np) >> FRACTION_PREC) & 0xFFFFFFFF);		\



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/914583da618b4ade4c64738a459f054417c504bd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20160123/fb5816e1/attachment.html>


More information about the vc mailing list