diff options
author | Michael Tiemann <tiemann@cygnus> | 1991-12-06 03:01:12 +0000 |
---|---|---|
committer | Michael Tiemann <tiemann@cygnus> | 1991-12-06 03:01:12 +0000 |
commit | 1cca172985962a849c34d4c676fe64ca7a27a772 (patch) | |
tree | 40704166829fa52702b474117f500179eadc128e /gdb/cplus-dem.c | |
parent | 715cafcbdeb1d3d74abc916aa2bb9d389e9010e9 (diff) | |
download | gdb-1cca172985962a849c34d4c676fe64ca7a27a772.zip gdb-1cca172985962a849c34d4c676fe64ca7a27a772.tar.gz gdb-1cca172985962a849c34d4c676fe64ca7a27a772.tar.bz2 |
Fix off-by-one error in cplus name demangling.
Diffstat (limited to 'gdb/cplus-dem.c')
-rw-r--r-- | gdb/cplus-dem.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gdb/cplus-dem.c b/gdb/cplus-dem.c index b34732c..e58a955 100644 --- a/gdb/cplus-dem.c +++ b/gdb/cplus-dem.c @@ -338,7 +338,8 @@ cplus_demangle (type, arg_mode) p += 1; while (*p != '\0' && !(*p == '_' && p[1] == '_')) p++; - string_appendn (&decl, type, p - type); + string_appendn (&decl, type, p - type); + string_need (&decl, 1); *(decl.p) = '\0'; munge_function_name (&decl, 1); if (decl.b[0] == '_') @@ -358,6 +359,7 @@ cplus_demangle (type, arg_mode) else { string_appendn (&decl, type, p - type); + string_need (&decl, 1); *(decl.p) = '\0'; munge_function_name (&decl, arg_mode); p += 2; |