[linux-nfc] [neard][PATCH 14/34] nciattach: do not shadow other local 'opt' variable (-Wshadow)

Krzysztof Kozlowski <[email protected]>
Newsgroups org.01.lists.linux-nfc,dev.linux.lists.oe-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
_______________________________________________
Linux-nfc mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
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.