Fix building objcopy under mingw64 by replacing uses of strndup with xstrndup.
authorRonald Hoogenboom <hoogenboom30@zonnet.nl>
Fri, 20 Nov 2015 14:08:29 +0000 (14:08 +0000)
committerNick Clifton <nickc@redhat.com>
Fri, 20 Nov 2015 14:08:29 +0000 (14:08 +0000)
* objcopy.c (parse_symflags): Use xstrndup in place of strndup.
(copy_main): Likewise.

binutils/ChangeLog
binutils/objcopy.c

index 6c87abd0021ffec33fbb87f164115a44a015085d..e1d8ea3882e55f2730f45cc72c192159b78b38c5 100644 (file)
@@ -1,3 +1,8 @@
+2015-11-20  Ronald Hoogenboom  <hoogenboom30@zonnet.nl>
+
+       * objcopy.c (parse_symflags): Use xstrndup in place of strndup.
+       (copy_main): Likewise.
+
 2015-11-20  Nick Clifton  <nickc@redhat.com>
 
        * po/ca.po: New Catalan translation.
index 0ff85251e59da6045d870ca01981008c8e333bb8..4a9f043d2ecb961160d492c922005bb154bbd88b 100644 (file)
@@ -771,7 +771,7 @@ parse_symflags (const char *s, char **other)
 
 #define PARSE_OTHER(fname,fval)                                                                   \
       else if (len >= (int) sizeof fname && strncasecmp (fname, s, sizeof fname - 1) == 0) \
-       fval = strndup (s + sizeof fname - 1, len - sizeof fname + 1)
+       fval = xstrndup (s + sizeof fname - 1, len - sizeof fname + 1)
       
       if (0) ;
       PARSE_FLAG ("local", BSF_LOCAL);
@@ -4082,10 +4082,10 @@ copy_main (int argc, char *argv[])
              fatal (_("bad format for %s"), "--add-symbol");
            t = strchr (s + 1, ':');
 
-           newsym->symdef = strndup (optarg, s - optarg);
+           newsym->symdef = xstrndup (optarg, s - optarg);
            if (t)
              {
-               newsym->section = strndup (s + 1, t - (s + 1));
+               newsym->section = xstrndup (s + 1, t - (s + 1));
                newsym->symval = strtol (t + 1, NULL, 0);
              }
            else
This page took 0.046104 seconds and 4 git commands to generate.