[Git][NTPsec/ntpsec][master] 4 commits: authreadkeys: fix format signs.

Gary E. Miller gitlab at mg.gitlab.com
Wed Apr 12 22:42:43 UTC 2017


Gary E. Miller pushed to branch master at NTPsec / ntpsec


Commits:
e04cc848 by Gary E. Miller at 2017-04-12T15:10:54-07:00
authreadkeys: fix format signs.

- - - - -
d426e6e2 by Gary E. Miller at 2017-04-12T15:15:25-07:00
libntp: fix format signs.

- - - - -
7555b814 by Gary E. Miller at 2017-04-12T15:32:28-07:00
fix format signedness.

- - - - -
03c35d89 by Gary E. Miller at 2017-04-12T15:41:15-07:00
ntp_control: fix format signed-ness

- - - - -


11 changed files:

- libntp/authreadkeys.c
- libntp/ntp_intres.c
- libntp/ntp_worker.c
- libntp/statestr.c
- libntp/timetoa.c
- ntpd/ntp_control.c
- ntpd/ntp_filegen.c
- ntpd/ntp_refclock.c
- ntpd/refclock_arbiter.c
- ntpd/refclock_gpsd.c
- ntpd/refclock_hpgps.c


Changes:

=====================================
libntp/authreadkeys.c
=====================================
--- a/libntp/authreadkeys.c
+++ b/libntp/authreadkeys.c
@@ -127,7 +127,7 @@ msyslog(LOG_ERR, "authreadkeys: reading %s", file);
 		token = nexttok(&line);
 		if (token == NULL) {
 			msyslog(LOG_ERR,
-			    "authreadkeys: no key type for key %d", keyno);
+			    "authreadkeys: no key type for key %u", keyno);
 			continue;
 		}
 		/*
@@ -153,12 +153,12 @@ msyslog(LOG_ERR, "authreadkeys: reading %s", file);
 			keytype = NID_md5;
 		if (keytype == 0) {
 			msyslog(LOG_ERR,
-			    "authreadkeys: invalid type for key %d", keyno);
+			    "authreadkeys: invalid type for key %u", keyno);
 			continue;
 		}
 		if (EVP_get_digestbynid(keytype) == NULL) {
 			msyslog(LOG_ERR,
-			    "authreadkeys: no algorithm for key %d", keyno);
+			    "authreadkeys: no algorithm for key %u", keyno);
 			continue;
 		}
 
@@ -171,7 +171,7 @@ msyslog(LOG_ERR, "authreadkeys: reading %s", file);
 		token = nexttok(&line);
 		if (token == NULL) {
 			msyslog(LOG_ERR,
-			    "authreadkeys: no key for key %d", keyno);
+			    "authreadkeys: no key for key %u", keyno);
 			continue;
 		}
 		len = strlen(token);
@@ -196,9 +196,10 @@ msyslog(LOG_ERR, "authreadkeys: reading %s", file);
 					keystr[j / 2] = temp << 4;
 			}
 			if (j < jlim) {
-				msyslog(LOG_ERR,
-					"authreadkeys: invalid hex digit for key %d", keyno);
-				continue;
+			    msyslog(LOG_ERR,
+				"authreadkeys: invalid hex digit for key %u",
+				keyno);
+			    continue;
 			}
 			mac_setkey(keyno, keytype, keystr, jlim / 2);
 			keys++;


=====================================
libntp/ntp_intres.c
=====================================
--- a/libntp/ntp_intres.c
+++ b/libntp/ntp_intres.c
@@ -299,9 +299,10 @@ blocking_getaddrinfo(
 	resp = emalloc_zero(resp_octets);
 	gai_resp = (void *)(resp + 1);
 
-	TRACE(2, ("blocking_getaddrinfo given node %s serv %s fam %d flags %x\n", 
-		  node, service, gai_req->hints.ai_family,
-		  gai_req->hints.ai_flags));
+	TRACE(2, 
+            ("blocking_getaddrinfo given node %s serv %s fam %d flags %x\n", 
+	     node, service, gai_req->hints.ai_family,
+	     (unsigned)gai_req->hints.ai_flags));
 #ifdef DEBUG
 	if (debug >= 2)
 		fflush(stdout);
@@ -648,9 +649,10 @@ blocking_getnameinfo(
 	resp = emalloc_zero(resp_octets);
 	gni_resp = (void *)((char *)resp + sizeof(*resp));
 
-	TRACE(2, ("blocking_getnameinfo given addr %s flags 0x%x hostlen %lu servlen %lu\n",
-		  socktoa(&gni_req->socku), gni_req->flags,
-		  (u_long)gni_req->hostoctets, (u_long)gni_req->servoctets));
+	TRACE(2, 
+          ("blocking_getnameinfo addr %s flags 0x%x hostlen %lu servlen %lu\n",
+	  socktoa(&gni_req->socku), (unsigned)gni_req->flags,
+	  (u_long)gni_req->hostoctets, (u_long)gni_req->servoctets));
 	
 	gni_resp->retcode = getnameinfo(&gni_req->socku.sa,
 					SOCKLEN(&gni_req->socku),


=====================================
libntp/ntp_worker.c
=====================================
--- a/libntp/ntp_worker.c
+++ b/libntp/ntp_worker.c
@@ -225,7 +225,8 @@ blocking_child_common(
 			break;
 
 		default:
-			msyslog(LOG_ERR, "unknown req %d to blocking worker", req->rtype);
+			msyslog(LOG_ERR, "unknown req %u to blocking worker",
+                                req->rtype);
 			say_bye = true;
 		}
 


=====================================
libntp/statestr.c
=====================================
--- a/libntp/statestr.c
+++ b/libntp/statestr.c
@@ -351,7 +351,7 @@ decode_bitflags(
 			   :
 #endif
 			     "",
-		 bits, (int)LIB_BUFLENGTH);
+		 (unsigned)bits, (int)LIB_BUFLENGTH);
 	errno = saved_errno;
 
 	return buf;


=====================================
libntp/timetoa.c
=====================================
--- a/libntp/timetoa.c
+++ b/libntp/timetoa.c
@@ -103,7 +103,7 @@ format_time_fraction(
 
 	/* finally format the data and return the result */
 	snprintf(cp, LIB_BUFLENGTH, "%s%llu.%0*ld",
-	    notneg? "" : "-", secs_u, prec_u, frac);
+	    notneg? "" : "-", secs_u, (int)prec_u, frac);
 	
 	return cp;
 }


=====================================
ntpd/ntp_control.c
=====================================
--- a/ntpd/ntp_control.c
+++ b/ntpd/ntp_control.c
@@ -797,7 +797,7 @@ process_control(
 	datapt = rpkt.data;
 
 	if ((rbufp->recv_length & 0x3) != 0)
-		DPRINTF(3, ("Control packet length %zd unrounded\n",
+		DPRINTF(3, ("Control packet length %zu unrounded\n",
 			    rbufp->recv_length));
 
 	/*
@@ -821,7 +821,7 @@ process_control(
 		res_authenticate = true;
 		pkid = (void *)((char *)pkt + properlen);
 		res_keyid = ntohl(*pkid);
-		DPRINTF(3, ("recv_len %zd, properlen %d, wants auth with keyid %08x, MAC length=%zu\n",
+		DPRINTF(3, ("recv_len %zu, properlen %d, wants auth with keyid %08x, MAC length=%zu\n",
 			    rbufp->recv_length, properlen, res_keyid,
 			    maclen));
 
@@ -4152,7 +4152,7 @@ report_event(
 		ctl_sys_num_events++;
 		snprintf(statstr, sizeof(statstr),
 		    "0.0.0.0 %04x %02x %s",
-		    ctlsysstatus(), err, eventstr(err));
+		    ctlsysstatus(), (unsigned)err, eventstr(err));
 		if (str != NULL) {
 			len = strlen(statstr);
 			snprintf(statstr + len, sizeof(statstr) - len,
@@ -4186,7 +4186,7 @@ report_event(
 
 		snprintf(statstr, sizeof(statstr),
 		    "%s %04x %02x %s", src,
-		    ctlpeerstatus(peer), err, eventstr(err));
+		    ctlpeerstatus(peer), (unsigned)err, eventstr(err));
 		if (str != NULL) {
 			len = strlen(statstr);
 			snprintf(statstr + len, sizeof(statstr) - len,


=====================================
ntpd/ntp_filegen.c
=====================================
--- a/ntpd/ntp_filegen.c
+++ b/ntpd/ntp_filegen.c
@@ -408,7 +408,7 @@ filegen_config(
 	DPRINTF(3, ("configuring filegen:\n"
 		    "\tdir:\t%s -> %s\n"
 		    "\tfname:\t%s -> %s\n"
-		    "\ttype:\t%d -> %d\n"
+		    "\ttype:\t%d -> %u\n"
 		    "\tflag: %x -> %x\n",
 		    gen->dir, dir,
 		    gen->fname, fname,


=====================================
ntpd/ntp_refclock.c
=====================================
--- a/ntpd/ntp_refclock.c
+++ b/ntpd/ntp_refclock.c
@@ -299,7 +299,7 @@ refclock_transmit(
 		uint8_t oreach;
 #ifdef DEBUG
 		if (debug)
-			printf("refclock_transmit: at %ld %s\n",
+			printf("refclock_transmit: at %lu %s\n",
 			    current_time, socktoa(&(peer->srcadr)));
 #endif
 
@@ -643,7 +643,7 @@ refclock_gtraw(
 	lineptr[bmax] = '\0';
 
 	*tsptr = rbufp->recv_time;
-	DPRINTF(2, ("refclock_gtraw: fd %d time %s timecode %zd %s\n",
+	DPRINTF(2, ("refclock_gtraw: fd %d time %s timecode %zu %s\n",
 		    rbufp->fd, ulfptoa(rbufp->recv_time, 6), bmax,
 		    lineptr));
 	return (bmax);


=====================================
ntpd/refclock_arbiter.c
=====================================
--- a/ntpd/refclock_arbiter.c
+++ b/ntpd/refclock_arbiter.c
@@ -180,14 +180,14 @@ arb_start(
 	memcpy((char *)&pp->refid, REFID, REFIDLEN);
 	peer->sstclktype = CTL_SST_TS_UHF;
 	if (peer->ttl > 1) {
-		msyslog(LOG_NOTICE, "ARBITER: Invalid mode %d", peer->ttl);
+		msyslog(LOG_NOTICE, "ARBITER: Invalid mode %u", peer->ttl);
 		close(fd);
 		pp->io.fd = -1;
 		free(up);
 		return false;
 	}
 #ifdef DEBUG
-	if(debug) { printf("arbiter: mode = %d.\n", peer->ttl); }
+	if(debug) { printf("arbiter: mode = %u.\n", peer->ttl); }
 #endif
 	IGNORE(write(pp->io.fd, COMMAND_HALT_BCAST, 2));
 	return true;


=====================================
ntpd/refclock_gpsd.c
=====================================
--- a/ntpd/refclock_gpsd.c
+++ b/ntpd/refclock_gpsd.c
@@ -206,7 +206,7 @@ typedef struct addrinfo     addrinfoT;
  * We use the same device name scheme as does the NMEA driver; since
  * GPSD supports the same links, we can select devices by a fixed name.
  */
-#define	DEVICE		"/dev/gps%u"	/* GPS serial device */
+#define	DEVICE		"/dev/gps%d"	/* GPS serial device */
 
 /* =====================================================================
  * forward declarations for transfer vector and the vector itself
@@ -1563,7 +1563,7 @@ process_tpv(
 		/* now parse the time string */
 		if (convert_ascii_time(&up->ibt_stamp, gps_time)) {
 			DPRINTF(2, ("%s: process_tpv, stamp='%s',"
-				    " recvt='%s' mode=%u\n",
+				    " recvt='%s' mode=%d\n",
 				    up->logname,
 				    gmprettydate(up->ibt_stamp),
 				    gmprettydate(up->ibt_recvt),


=====================================
ntpd/refclock_hpgps.c
=====================================
--- a/ntpd/refclock_hpgps.c
+++ b/ntpd/refclock_hpgps.c
@@ -415,9 +415,11 @@ hpgps_receive(
 
 	    case '2':
 		m = sscanf(tcp,"%*c%*c%4d%2d%2d%2d%2d%2d%c%c%c%c%c%2hx",
-			   &pp->year, &month, &day, &pp->hour, &pp->minute, &pp->second,
-			   &timequal, &freqqual, &leapchar, &servchar, &syncchar,
-			   &expectedsm);
+			   &pp->year, &month, &day, &pp->hour, &pp->minute,
+                           &pp->second,
+			   &timequal, &freqqual, &leapchar, &servchar,
+                           &syncchar,
+			   (short unsigned int*)&expectedsm);
 		n = NTCODET2;
 
 		if (m != MTCODET2){



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/d9f5e064bf240946abd0b7bd6727b57294aec21f...03c35d891562f1ca4d0d45905b6dfba04f72b53a

---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/d9f5e064bf240946abd0b7bd6727b57294aec21f...03c35d891562f1ca4d0d45905b6dfba04f72b53a
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/20170412/ac3495f3/attachment.html>


More information about the vc mailing list