Révision | a4f8732b2a0c2cf48cff088311ed0ee2b17435b9 (tree) |
---|---|
l'heure | 2015-11-20 23:08:29 |
Auteur | Ronald Hoogenboom <hoogenboom30@zonn...> |
Commiter | Nick Clifton |
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.
@@ -1,3 +1,8 @@ | ||
1 | +2015-11-20 Ronald Hoogenboom <hoogenboom30@zonnet.nl> | |
2 | + | |
3 | + * objcopy.c (parse_symflags): Use xstrndup in place of strndup. | |
4 | + (copy_main): Likewise. | |
5 | + | |
1 | 6 | 2015-11-20 Nick Clifton <nickc@redhat.com> |
2 | 7 | |
3 | 8 | * po/ca.po: New Catalan translation. |
@@ -771,7 +771,7 @@ parse_symflags (const char *s, char **other) | ||
771 | 771 | |
772 | 772 | #define PARSE_OTHER(fname,fval) \ |
773 | 773 | else if (len >= (int) sizeof fname && strncasecmp (fname, s, sizeof fname - 1) == 0) \ |
774 | - fval = strndup (s + sizeof fname - 1, len - sizeof fname + 1) | |
774 | + fval = xstrndup (s + sizeof fname - 1, len - sizeof fname + 1) | |
775 | 775 | |
776 | 776 | if (0) ; |
777 | 777 | PARSE_FLAG ("local", BSF_LOCAL); |
@@ -4082,10 +4082,10 @@ copy_main (int argc, char *argv[]) | ||
4082 | 4082 | fatal (_("bad format for %s"), "--add-symbol"); |
4083 | 4083 | t = strchr (s + 1, ':'); |
4084 | 4084 | |
4085 | - newsym->symdef = strndup (optarg, s - optarg); | |
4085 | + newsym->symdef = xstrndup (optarg, s - optarg); | |
4086 | 4086 | if (t) |
4087 | 4087 | { |
4088 | - newsym->section = strndup (s + 1, t - (s + 1)); | |
4088 | + newsym->section = xstrndup (s + 1, t - (s + 1)); | |
4089 | 4089 | newsym->symval = strtol (t + 1, NULL, 0); |
4090 | 4090 | } |
4091 | 4091 | else |