]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
upstream: Remove some set but otherwise unused variables, spotted
authordtucker@openbsd.org <dtucker@openbsd.org>
Mon, 7 Nov 2022 10:05:38 +0000 (10:05 +0000)
committerDarren Tucker <dtucker@dtucker.net>
Mon, 7 Nov 2022 11:22:15 +0000 (22:22 +1100)
in -portable by clang 16's -Wunused-but-set-variable.  ok djm@

OpenBSD-Commit-ID: 3d943ddf2369b38fbf89f5f19728e7dc1daf3982

kex.c
servconf.c

diff --git a/kex.c b/kex.c
index 0bcd27dc5825c41a0ad4a1139d519bb2e7b9b1e3..8cdefcf7cbb9ada913290213862521980d0c8662 100644 (file)
--- 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);
index bba3ad80fa040d38dc30ee34b08b14a78303bd71..8eaedde9ea9e61ac81964e7ec7f5a0d85dcfa6a1 100644 (file)
@@ -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@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