From: deraadt Date: Mon, 18 Sep 2023 15:16:22 +0000 (+0000) Subject: 2 cases of c99 for-scope variable decl, when a variable already exists X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=113726744fcac5dad22546760e5bc8cd6ccbbf9f;p=openbsd 2 cases of c99 for-scope variable decl, when a variable already exists in scope. but a 3rd similar situation in the same scope exists also, which does not create a new variable, and uses the upper scope variable. Pretty sloppy stuff. ok millert --- diff --git a/usr.bin/awk/run.c b/usr.bin/awk/run.c index 6d2658fcb75..c4719bbd516 100644 --- a/usr.bin/awk/run.c +++ b/usr.bin/awk/run.c @@ -1,4 +1,4 @@ -/* $OpenBSD: run.c,v 1.75 2023/09/17 14:49:44 millert Exp $ */ +/* $OpenBSD: run.c,v 1.76 2023/09/18 15:16:22 deraadt Exp $ */ /**************************************************************** Copyright (C) Lucent Technologies 1997 All Rights Reserved @@ -1350,7 +1350,7 @@ int format(char **pbuf, int *pbufsize, const char *s, Node *a) /* printf-like co int i; if (ljust) { // print one char from t, then pad blanks - for (int i = 0; i < n; i++) + for (i = 0; i < n; i++) *p++ = t[i]; for (i = 0; i < pad; i++) { //printf(" "); @@ -1361,7 +1361,7 @@ int format(char **pbuf, int *pbufsize, const char *s, Node *a) /* printf-like co //printf(" "); *p++ = ' '; } - for (int i = 0; i < n; i++) + for (i = 0; i < n; i++) *p++ = t[i]; } *p = 0;