aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>1994-11-11 19:17:41 +0000
committerJeff Law <law@redhat.com>1994-11-11 19:17:41 +0000
commita30e2087390894e9d502ee5344e16e3838543ef2 (patch)
tree8453f2f86592234a3b6c7acefe70ce956e916a09
parentc2e00af68ec68a2c6aaf4f82d909185de11168aa (diff)
downloadgdb-a30e2087390894e9d502ee5344e16e3838543ef2.zip
gdb-a30e2087390894e9d502ee5344e16e3838543ef2.tar.gz
gdb-a30e2087390894e9d502ee5344e16e3838543ef2.tar.bz2
* ch-exp.y (yylex): Fix off-by-one error when converting string to
lowercase. Null terminate new string.
-rw-r--r--gdb/ChangeLog3
-rw-r--r--gdb/ch-exp.y3
2 files changed, 5 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 6e4a122..7245a39 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -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
diff --git a/gdb/ch-exp.y b/gdb/ch-exp.y
index b7a0b5e..191abe6 100644
--- a/gdb/ch-exp.y
+++ b/gdb/ch-exp.y
@@ -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++)