aboutsummaryrefslogtreecommitdiff
path: root/libiberty
diff options
context:
space:
mode:
Diffstat (limited to 'libiberty')
-rw-r--r--libiberty/ChangeLog5
-rw-r--r--libiberty/argv.c2
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);