Module Name:    src
Committed By:   christos
Date:           Wed May 27 23:52:20 UTC 2020

Modified Files:
        src/external/bsd/ntp/dist/ntpd: ntp_config.c refclock_neoclock4x.c
        src/external/bsd/ntp/dist/ntpq: ntpq.c
        src/external/bsd/ntp/dist/util: ntp-keygen.c

Log Message:
Adjustments to our patches requested by upstream


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/external/bsd/ntp/dist/ntpd/ntp_config.c
cvs rdiff -u -r1.11 -r1.12 \
    src/external/bsd/ntp/dist/ntpd/refclock_neoclock4x.c
cvs rdiff -u -r1.21 -r1.22 src/external/bsd/ntp/dist/ntpq/ntpq.c
cvs rdiff -u -r1.13 -r1.14 src/external/bsd/ntp/dist/util/ntp-keygen.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/ntp_config.c
diff -u src/external/bsd/ntp/dist/ntpd/ntp_config.c:1.22 src/external/bsd/ntp/dist/ntpd/ntp_config.c:1.23
--- src/external/bsd/ntp/dist/ntpd/ntp_config.c:1.22	Mon May 25 16:47:25 2020
+++ src/external/bsd/ntp/dist/ntpd/ntp_config.c	Wed May 27 19:52:19 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_config.c,v 1.22 2020/05/25 20:47:25 christos Exp $	*/
+/*	$NetBSD: ntp_config.c,v 1.23 2020/05/27 23:52:19 christos Exp $	*/
 
 /* ntp_config.c
  *
@@ -3892,7 +3892,7 @@ config_fudge(
 
 			case T_Refid:
 				clock_stat.haveflags |= CLK_HAVEVAL2;
-				/* strncpy() does exactly what we want here: */
+				/* avoid using strncpy because gcc warns */
 				len = strlen(curr_opt->value.s);
 				if (len > sizeof(clock_stat.fudgeval2))
 					len = sizeof(clock_stat.fudgeval2);

Index: src/external/bsd/ntp/dist/ntpd/refclock_neoclock4x.c
diff -u src/external/bsd/ntp/dist/ntpd/refclock_neoclock4x.c:1.11 src/external/bsd/ntp/dist/ntpd/refclock_neoclock4x.c:1.12
--- src/external/bsd/ntp/dist/ntpd/refclock_neoclock4x.c:1.11	Mon May 25 16:47:25 2020
+++ src/external/bsd/ntp/dist/ntpd/refclock_neoclock4x.c	Wed May 27 19:52:19 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: refclock_neoclock4x.c,v 1.11 2020/05/25 20:47:25 christos Exp $	*/
+/*	$NetBSD: refclock_neoclock4x.c,v 1.12 2020/05/27 23:52:19 christos Exp $	*/
 
 /*
  *
@@ -727,6 +727,7 @@ neoclock4x_control(int unit,
   if(NULL != out)
     {
       char *tt;
+      /* the 199 here is almost 2x the max string */
       char tmpbuf[199];
 
       out->kv_list = (struct ctl_var *)0;
@@ -767,6 +768,7 @@ neoclock4x_control(int unit,
         snprintf(tt, 39, "dststatus=\"winter\"");
       else
         snprintf(tt, 39, "dststatus=\"unknown\"");
+      /* the 99 below is greater than 80 the max string */
       tt = add_var(&out->kv_list, 80, RO|DEF);
       snprintf(tt, 99, "firmware=\"%s\"", up->firmware);
       tt = add_var(&out->kv_list, 40, RO|DEF);

Index: src/external/bsd/ntp/dist/ntpq/ntpq.c
diff -u src/external/bsd/ntp/dist/ntpq/ntpq.c:1.21 src/external/bsd/ntp/dist/ntpq/ntpq.c:1.22
--- src/external/bsd/ntp/dist/ntpq/ntpq.c:1.21	Mon May 25 16:47:26 2020
+++ src/external/bsd/ntp/dist/ntpq/ntpq.c	Wed May 27 19:52:19 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntpq.c,v 1.21 2020/05/25 20:47:26 christos Exp $	*/
+/*	$NetBSD: ntpq.c,v 1.22 2020/05/27 23:52:19 christos Exp $	*/
 
 /*
  * ntpq - query an NTP server using mode 6 commands
@@ -3738,7 +3738,7 @@ cookedprint(
 		case SN:
 			if (!value)
 				output_raw = '?';
-			else if (isdigit((unsigned char)*value)) {	/* number without sign */
+			else if (isdigit(*(const unsigned char *)value)) {	/* number without sign */
 				bv[0] = '+';
 				atoascii (value, MAXVALLEN, bv+1, sizeof(bv)-1);
 				output(fp, name, bv);

Index: src/external/bsd/ntp/dist/util/ntp-keygen.c
diff -u src/external/bsd/ntp/dist/util/ntp-keygen.c:1.13 src/external/bsd/ntp/dist/util/ntp-keygen.c:1.14
--- src/external/bsd/ntp/dist/util/ntp-keygen.c:1.13	Mon May 25 16:47:37 2020
+++ src/external/bsd/ntp/dist/util/ntp-keygen.c	Wed May 27 19:52:20 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp-keygen.c,v 1.13 2020/05/25 20:47:37 christos Exp $	*/
+/*	$NetBSD: ntp-keygen.c,v 1.14 2020/05/27 23:52:20 christos Exp $	*/
 
 /*
  * Program to generate cryptographic keys for ntp clients and servers
@@ -281,7 +281,7 @@ followlink(
 
 	REQUIRE(bufsiz > 0);
 
-	len = readlink(fname, result, bufsiz);
+	len = readlink(fname, result, sizeof(result));
 	if (len < 0) {
 		fname[0] = '\0';
 		return;

Reply via email to