diff options
author | Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> | 2021-07-11 14:05:55 +0200 |
---|---|---|
committer | Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> | 2021-07-19 12:44:07 +0200 |
commit | 9bbec22a76f22423fc2b51f9a8fab3ed1fc02876 (patch) | |
tree | 8126b1d0ab98b497b717bbce8fb9bc1025614ab3 | |
parent | a4c726f7869775404b0db20277de465ba82bbb2c (diff) | |
download | neard-9bbec22a76f22423fc2b51f9a8fab3ed1fc02876.tar.gz |
nciattach: do not shadow other local 'opt' variable (-Wshadow)
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@canonical.com>
-rw-r--r-- | tools/nciattach.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/nciattach.c b/tools/nciattach.c index 574c0fb..4ac37d8 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: |