[openssh-commits] [openssh] 02/03: upstream: Remove some set but otherwise unused variables, spotted

git+noreply at mindrot.org git+noreply at mindrot.org
Mon Nov 7 22:23:01 AEDT 2022


This is an automated email from the git hooks/post-receive script.

dtucker pushed a commit to branch master
in repository openssh.

commit 747691604d3325ed2b62bad85b6fd8563ad32f6c
Author: dtucker at openbsd.org <dtucker at openbsd.org>
Date:   Mon Nov 7 10:05:38 2022 +0000

    upstream: Remove some set but otherwise unused variables, spotted
    
    in -portable by clang 16's -Wunused-but-set-variable.  ok djm@
    
    OpenBSD-Commit-ID: 3d943ddf2369b38fbf89f5f19728e7dc1daf3982
---
 kex.c      | 6 +++---
 servconf.c | 5 ++---
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/kex.c b/kex.c
index 0bcd27dc..8cdefcf7 100644
--- a/kex.c
+++ b/kex.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kex.c,v 1.172 2022/02/01 23:32:51 djm Exp $ */
+/* $OpenBSD: kex.c,v 1.173 2022/11/07 10:05:38 dtucker Exp $ */
 /*
  * Copyright (c) 2000, 2001 Markus Friedl.  All rights reserved.
  *
@@ -1215,7 +1215,7 @@ kex_exchange_identification(struct ssh *ssh, int timeout_ms,
     const char *version_addendum)
 {
 	int remote_major, remote_minor, mismatch, oerrno = 0;
-	size_t len, i, n;
+	size_t len, n;
 	int r, expect_nl;
 	u_char c;
 	struct sshbuf *our_version = ssh->kex->server ?
@@ -1271,7 +1271,7 @@ kex_exchange_identification(struct ssh *ssh, int timeout_ms,
 		}
 		sshbuf_reset(peer_version);
 		expect_nl = 0;
-		for (i = 0; ; i++) {
+		for (;;) {
 			if (timeout_ms > 0) {
 				r = waitrfd(ssh_packet_get_connection_in(ssh),
 				    &timeout_ms);
diff --git a/servconf.c b/servconf.c
index bba3ad80..8eaedde9 100644
--- a/servconf.c
+++ b/servconf.c
@@ -1,5 +1,5 @@
 
-/* $OpenBSD: servconf.c,v 1.387 2022/11/07 10:02:59 dtucker Exp $ */
+/* $OpenBSD: servconf.c,v 1.388 2022/11/07 10:05:39 dtucker Exp $ */
 /*
  * Copyright (c) 1995 Tatu Ylonen <ylo at cs.hut.fi>, Espoo, Finland
  *                    All rights reserved
@@ -2501,7 +2501,7 @@ load_server_config(const char *filename, struct sshbuf *conf)
 	char *line = NULL, *cp;
 	size_t linesize = 0;
 	FILE *f;
-	int r, lineno = 0;
+	int r;
 
 	debug2_f("filename %s", filename);
 	if ((f = fopen(filename, "r")) == NULL) {
@@ -2514,7 +2514,6 @@ load_server_config(const char *filename, struct sshbuf *conf)
 	    (r = sshbuf_allocate(conf, st.st_size)) != 0)
 		fatal_fr(r, "allocate");
 	while (getline(&line, &linesize, f) != -1) {
-		lineno++;
 		/*
 		 * Strip whitespace
 		 * NB - preserve newlines, they are needed to reproduce

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list