aboutsummaryrefslogtreecommitdiff
path: root/libiberty/argv.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2016-01-03 01:29:03 -0500
committerMike Frysinger <vapier@gentoo.org>2016-01-05 15:02:57 -0500
commit203217665139943a4f0d1797b9a5f913b3acf184 (patch)
treef863ffb232c8ce009c1dc589e7d164ced87b20c4 /libiberty/argv.c
parent4bec0ef03e91506caf60d8842786b29c2d2ff049 (diff)
downloadgdb-203217665139943a4f0d1797b9a5f913b3acf184.zip
gdb-203217665139943a4f0d1797b9a5f913b3acf184.tar.gz
gdb-203217665139943a4f0d1797b9a5f913b3acf184.tar.bz2
libiberty: dupargv: rewrite to use xstrdup
This func is basically open coding the xstrdup function, so gut it and use it directly.
Diffstat (limited to 'libiberty/argv.c')
-rw-r--r--libiberty/argv.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/libiberty/argv.c b/libiberty/argv.c
index f2727e8..5c3dd70 100644
--- a/libiberty/argv.c
+++ b/libiberty/argv.c
@@ -76,11 +76,7 @@ dupargv (char **argv)
/* the strings */
for (argc = 0; argv[argc] != NULL; argc++)
- {
- int len = strlen (argv[argc]);
- copy[argc] = (char *) xmalloc (len + 1);
- strcpy (copy[argc], argv[argc]);
- }
+ copy[argc] = xstrdup (argv[argc]);
copy[argc] = NULL;
return copy;
}