objcopy: Avoid shadowing optarg.
authorAndrew Burgess <andrew.burgess@embecosm.com>
Thu, 26 Feb 2015 17:17:46 +0000 (17:17 +0000)
committerAndrew Burgess <andrew.burgess@embecosm.com>
Thu, 26 Feb 2015 18:05:10 +0000 (18:05 +0000)
In commit 7173b38a442c007a554ea200817a0eadce89c87b I used optarg as the
name for a function parameter, shadowing the global of that name.  This
commit changes the function parameter to be called arg.

binutils/ChangeLog:

* objcopy.c (init_section_add): Rename optarg to arg in order to
avoid shadowing a global variable.

binutils/ChangeLog
binutils/objcopy.c

index 3a42b724de9a51a1b94d6c0c2c2d1491a4ade838..6caa4fa266f6e6d0216d229411cc284a9f15f114 100644 (file)
@@ -1,3 +1,8 @@
+2015-02-26  Andrew Burgess  <andrew.burgess@embecosm.com>
+
+       * objcopy.c (init_section_add): Rename optarg to arg in order to
+       avoid shadowing a global variable.
+
 2015-02-26  Nick Clifton  <nickc@redhat.com>
 
        PR binutils/17512
index 5cb4b13857e9ca6b6343901cb0d0cb540bcfe353..7f094d343ec9cc0dda841763c084fcdf407f7af6 100644 (file)
@@ -3547,25 +3547,25 @@ convert_efi_target (char *efi)
 }
 
 /* Allocate and return a pointer to a struct section_add, initializing the
-   structure using OPTARG, a string in the format "sectionname=filename".
+   structure using ARG, a string in the format "sectionname=filename".
    The returned structure will have its next pointer set to NEXT.  The
    OPTION field is the name of the command line option currently being
    parsed, and is only used if an error needs to be reported.  */
 
 static struct section_add *
-init_section_add (const char *optarg,
+init_section_add (const char *arg,
                   struct section_add *next,
                   const char *option)
 {
   struct section_add *pa;
   const char *s;
 
-  s = strchr (optarg, '=');
+  s = strchr (arg, '=');
   if (s == NULL)
     fatal (_("bad format for %s"), option);
 
   pa = (struct section_add *) xmalloc (sizeof (struct section_add));
-  pa->name = xstrndup (optarg, s - optarg);
+  pa->name = xstrndup (arg, s - arg);
   pa->filename = s + 1;
   pa->next = next;
   pa->contents = NULL;
This page took 0.028451 seconds and 4 git commands to generate.