aboutsummaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
authorRonald Hoogenboom <hoogenboom30@zonnet.nl>2015-11-20 14:08:29 +0000
committerNick Clifton <nickc@redhat.com>2015-11-20 14:08:29 +0000
commita4f8732b2a0c2cf48cff088311ed0ee2b17435b9 (patch)
treeac538140e30e591f40ef9991c11d628490856cbc /binutils
parentf075eb5e6b0dd850304f78cf4d5c94df7b44c7a3 (diff)
downloadgdb-a4f8732b2a0c2cf48cff088311ed0ee2b17435b9.zip
gdb-a4f8732b2a0c2cf48cff088311ed0ee2b17435b9.tar.gz
gdb-a4f8732b2a0c2cf48cff088311ed0ee2b17435b9.tar.bz2
Fix building objcopy under mingw64 by replacing uses of strndup with xstrndup.
* objcopy.c (parse_symflags): Use xstrndup in place of strndup. (copy_main): Likewise.
Diffstat (limited to 'binutils')
-rw-r--r--binutils/ChangeLog5
-rw-r--r--binutils/objcopy.c6
2 files changed, 8 insertions, 3 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 6c87abd..e1d8ea3 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -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.
diff --git a/binutils/objcopy.c b/binutils/objcopy.c
index 0ff8525..4a9f043 100644
--- a/binutils/objcopy.c
+++ b/binutils/objcopy.c
@@ -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