From bf33f4dcaaf87e4fbb0404d04644d64d50484a0a Mon Sep 17 00:00:00 2001 From: dtucker Date: Mon, 7 Nov 2022 10:05:38 +0000 Subject: [PATCH] Remove some set but otherwise unused variables, spotted in -portable by clang 16's -Wunused-but-set-variable. ok djm@ --- usr.bin/ssh/kex.c | 6 +++--- usr.bin/ssh/servconf.c | 5 ++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/usr.bin/ssh/kex.c b/usr.bin/ssh/kex.c index 88cb950ddb6..3f31b97c28f 100644 --- a/usr.bin/ssh/kex.c +++ b/usr.bin/ssh/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. * @@ -1198,7 +1198,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 ? @@ -1254,7 +1254,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/usr.bin/ssh/servconf.c b/usr.bin/ssh/servconf.c index 9822ff33073..78dcf447220 100644 --- a/usr.bin/ssh/servconf.c +++ b/usr.bin/ssh/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 @@ -2440,7 +2440,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) { @@ -2453,7 +2453,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 -- 2.20.1