From: dtucker@openbsd.org Date: Mon, 7 Nov 2022 10:05:38 +0000 (+0000) Subject: upstream: Remove some set but otherwise unused variables, spotted X-Git-Tag: V_9_2_P1~125 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=747691604d3325ed2b62bad85b6fd8563ad32f6c;p=thirdparty%2Fopenssh-portable.git 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 --- diff --git a/kex.c b/kex.c index 0bcd27dc5..8cdefcf7c 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 bba3ad80f..8eaedde9e 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 , 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