diff options
author | Jeff Law <law@redhat.com> | 1994-11-11 19:17:41 +0000 |
---|---|---|
committer | Jeff Law <law@redhat.com> | 1994-11-11 19:17:41 +0000 |
commit | a30e2087390894e9d502ee5344e16e3838543ef2 (patch) | |
tree | 8453f2f86592234a3b6c7acefe70ce956e916a09 /gdb/ch-exp.y | |
parent | c2e00af68ec68a2c6aaf4f82d909185de11168aa (diff) | |
download | gdb-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.
Diffstat (limited to 'gdb/ch-exp.y')
-rw-r--r-- | gdb/ch-exp.y | 3 |
1 files changed, 2 insertions, 1 deletions
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++) |