summaryrefslogtreecommitdiff
path: root/src/numfmt.c
diff options
context:
space:
mode:
authorJim Meyering <meyering@fb.com>2015-06-29 10:25:07 -0700
committerJim Meyering <meyering@fb.com>2015-06-29 11:11:49 -0700
commit46416bb7c365e4faf44152dd66094c726dc714c8 (patch)
tree43f03c5fd061d857692157d1b7a7c04de7d73be6 /src/numfmt.c
parentbadecb3f6ce21e9ad12402d4dd96d9a532499710 (diff)
downloadcoreutils-46416bb7c365e4faf44152dd66094c726dc714c8.tar.xz
build: numfmt.c: avoid a shadowing warning
* src/numfmt.c (parse_field_arg): Rename parameter s/optarg/arg/, to avoid shadowing getopt's global variable. Otherwise, building on OS X, with --enable-gcc-warnings, I saw this: In file included from src/numfmt.c:19:0: src/numfmt.c: In function 'parse_field_arg': ./lib/config.h:3109:25: error: declaration of 'rpl_optarg' shadows\ a global declaration [-Werror=shadow]
Diffstat (limited to 'src/numfmt.c')
-rw-r--r--src/numfmt.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/numfmt.c b/src/numfmt.c
index 09cdd422f..e58972bce 100644
--- a/src/numfmt.c
+++ b/src/numfmt.c
@@ -1354,7 +1354,7 @@ free_field (const void *elt)
TODO: Refactor the more performant cut implementation
for use by both utilities. */
static void
-parse_field_arg (char *optarg)
+parse_field_arg (char *arg)
{
char *start, *end;
@@ -1362,9 +1362,9 @@ parse_field_arg (char *optarg)
size_t field_val;
size_t range_val = 0;
- start = end = optarg;
+ start = end = arg;
- if (STREQ (optarg, "-"))
+ if (STREQ (arg, "-"))
{
all_fields = true;
@@ -1438,7 +1438,7 @@ parse_field_arg (char *optarg)
if (range_val)
{
/* range N-
- range_val was not reset indicating optarg
+ range_val was not reset indicating ARG
ended with a trailing '-' */
all_fields_after = range_val;
}