* ch-exp.y (yylex): Fix off-by-one error when converting string to
authorJeff Law <law@redhat.com>
Fri, 11 Nov 1994 19:17:41 +0000 (19:17 +0000)
committerJeff Law <law@redhat.com>
Fri, 11 Nov 1994 19:17:41 +0000 (19:17 +0000)
lowercase.  Null terminate new string.

gdb/ChangeLog
gdb/ch-exp.y

index 6e4a1223e376362cf5efed2fa3747ef746108008..7245a393799082f651804858e000495912ddb8cd 100644 (file)
@@ -1,5 +1,8 @@
 Fri Nov 11 10:51:07 1994  Jeff Law  (law@snake.cs.utah.edu)
 
+       * ch-exp.y (yylex): Fix off-by-one error when converting string to
+       lowercase.  Null terminate new string.
+
        * hppa-tdep.c (rp_saved): Handle IMPORT stubs too.
 
        * somsolib.c (som_solib_add): Check the value of __dld_flags, if
index b7a0b5ec8c1ff82f354061a83446a96029ee224f..191abe6003390ad716e1872a6c29d20317777508 100644 (file)
@@ -1844,11 +1844,12 @@ yylex ()
 
     if (inputname != NULL)
       {
-       char *simplename = (char*) alloca (strlen (inputname));
+       char *simplename = (char*) alloca (strlen (inputname) + 1);
 
        char *dptr = simplename, *sptr = inputname;
        for (; *sptr; sptr++)
          *dptr++ = isupper (*sptr) ? tolower(*sptr) : *sptr;
+       *dptr = '\0';
 
        /* See if it is a reserved identifier. */
        for (i = 0; i < sizeof (idtokentab) / sizeof (idtokentab[0]); i++)
This page took 0.026339 seconds and 4 git commands to generate.