forked from Imagelibrary/binutils-gdb
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.
This commit is contained in:
committed by
Nick Clifton
parent
f075eb5e6b
commit
a4f8732b2a
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user