diff options
author | DJ Delorie <dj@redhat.com> | 2005-04-14 02:22:18 +0000 |
---|---|---|
committer | DJ Delorie <dj@redhat.com> | 2005-04-14 02:22:18 +0000 |
commit | ab70e2a569bcef40653fc3cad7ddf64d24256433 (patch) | |
tree | 1a98ac2f8f2ddf5525b689837630265b8f50379f /libiberty | |
parent | 8699aa54a266e568d5c2c59762d64edd96f11211 (diff) | |
download | gdb-ab70e2a569bcef40653fc3cad7ddf64d24256433.zip gdb-ab70e2a569bcef40653fc3cad7ddf64d24256433.tar.gz gdb-ab70e2a569bcef40653fc3cad7ddf64d24256433.tar.bz2 |
merge from gcc
Diffstat (limited to 'libiberty')
-rw-r--r-- | libiberty/ChangeLog | 5 | ||||
-rw-r--r-- | libiberty/argv.c | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index bdede48..d06406a 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,8 @@ +2005-04-13 Gabriel Dos Reis <gdr@integrable-solutions.net> + + * argv.c (dupargv): Allocate space of argv[argc], not + sizeof(char *) of that amount. Cast result to char *. + 2005-04-12 Gabriel Dos Reis <gdr@integrable-solutions.net> * regex.c (wcs_re_match_2_internal, byte_re_match_2_internal): diff --git a/libiberty/argv.c b/libiberty/argv.c index 7650205..ad4c9a7 100644 --- a/libiberty/argv.c +++ b/libiberty/argv.c @@ -77,7 +77,7 @@ dupargv (char **argv) for (argc = 0; argv[argc] != NULL; argc++) { int len = strlen (argv[argc]); - copy[argc] = malloc (sizeof (char *) * (len + 1)); + copy[argc] = (char *) malloc (len + 1); if (copy[argc] == NULL) { freeargv (copy); |