From 9b6a8a6c87eaaf75056cde0c4cc0c75e03e6ce39 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Mon, 18 Sep 2023 15:16:23 +0000 Subject: 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 --- usr.bin/awk/run.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'usr.bin/awk/run.c') 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; -- cgit v1.2.3