jcf-path.c (add_entry): alloca len+2 rather than len+1 bytes...
authorAndrew Haley <aph@cygnus.com>
Fri, 12 Mar 1999 07:52:58 +0000 (07:52 +0000)
committerAndrew Haley <aph@gcc.gnu.org>
Fri, 12 Mar 1999 07:52:58 +0000 (07:52 +0000)
1999-03-12  Andrew Haley  <aph@cygnus.com>
        * jcf-path.c (add_entry): alloca len+2 rather than len+1 bytes;
        we'll need a directory separator and a null character.

From-SVN: r25726

gcc/java/ChangeLog
gcc/java/jcf-path.c

index 07eecd82530821d189c74baae2b85752238775c8..ecd1b523f0749702c81976647161479657eb6187 100644 (file)
@@ -1,3 +1,8 @@
+1999-03-12  Andrew Haley  <aph@cygnus.com>
+
+       * jcf-path.c (add_entry): alloca len+2 rather than len+1 bytes;
+        we'll need a directory separator and a null character.
+
 Wed Mar 10 23:20:11 1999  Per Bothner  <bothner@cygnus.com>
 
        * jcf-write.c (generate_bytecode_insns):  Handle __builtin_fmod, for %.
index 0c590c5760349811ac9e6d795d2283fcc43c9521..bdd951506f47ce164ad92cf07e9713a954fbe6c8 100644 (file)
@@ -158,7 +158,7 @@ add_entry (entp, filename, is_system)
      work more easily.  Eww.  */
   if (filename[len - 1] != '/' && filename[len - 1] != DIR_SEPARATOR)
     {
-      char *f2 = (char *) alloca (len + 1);
+      char *f2 = (char *) alloca (len + 2);
       strcpy (f2, filename);
       f2[len] = DIR_SEPARATOR;
       f2[len + 1] = '\0';