]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
argv.c (dupargv): Mallocate space of argv[argc], not sizeof(char *) of that amuont.
authorGabriel Dos Reis <gdr@integrable-solutions.net>
Wed, 13 Apr 2005 13:49:19 +0000 (13:49 +0000)
committerGabriel Dos Reis <gdr@gcc.gnu.org>
Wed, 13 Apr 2005 13:49:19 +0000 (13:49 +0000)
* argv.c (dupargv): Mallocate space of argv[argc], not
sizeof(char *) of that amuont.  Cast result to char *.

From-SVN: r98083

libiberty/ChangeLog
libiberty/argv.c

index bdede48bbc961d46f0ffcee419cf4338242c0b8f..6ee01fae1d5619615ad8887997da69fb5579762d 100644 (file)
@@ -1,3 +1,8 @@
+2005-04-13  Gabriel Dos Reis  <gdr@integrable-solutions.net>
+
+       * argv.c (dupargv): Mallocate space of argv[argc], not 
+       sizeof(char *) of that amuont.  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):
index 76502058d3eee64feabebac84967c9d9a2541f2a..ad4c9a79388aef37350af5a96b7366c0a7771e0e 100644 (file)
@@ -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);