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 <krzysztof.kozlowski(a)canonical.com>
---
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