[neard][PATCH v2 24/73] nciattach: do not shadow other local 'opt' variable (-Wshadow)

Krzysztof Kozlowski <[email protected]>
Newsgroups dev.linux.lists.oe-linux-nfc,org.01.lists.linux-nfc
Message-ID <[email protected]>
Fix -Wshadow warning:

    tools/nciattach.c: In function ‘main’:
    tools/nciattach.c:272:9: error: declaration of ‘opt’ shadows a previous local [-Werror=shadow]
      272 |   char *opt;
          |         ^~~
    tools/nciattach.c:236:24: note: shadowed declaration is here
      236 |  int detach, printpid, opt, i, n, ld, err;
          |                        ^~~

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
 tools/nciattach.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/nciattach.c b/tools/nciattach.c
index 574c0fbe784a..4ac37d82d545 100644
--- a/tools/nciattach.c
+++ b/tools/nciattach.c
@@ -269,16 +269,16 @@ int main(int argc, char *argv[])
 	}
 
 	for (n = 0; optind < argc; n++, optind++) {
-		char *opt;
+		char *option;
 
-		opt = argv[optind];
+		option = argv[optind];
 
 		switch(n) {
 		case 0:
 			dev[0] = 0;
-			if (!strchr(opt, '/'))
+			if (!strchr(option, '/'))
 				strcpy(dev, "/dev/");
-			strcat(dev, opt);
+			strcat(dev, option);
 			break;
 
 		case 1:
-- 
2.27.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.