aboutsummaryrefslogtreecommitdiff
path: root/gdb/c-lang.c
diff options
context:
space:
mode:
authorJohn Gilmore <gnu@cygnus>1993-02-18 23:49:40 +0000
committerJohn Gilmore <gnu@cygnus>1993-02-18 23:49:40 +0000
commit961ccde634c48fe95887cbfc5e3d15debc4d4818 (patch)
tree4add3d1091dfa8e2069a29cb17547d2e1ad57835 /gdb/c-lang.c
parent7e57a051f7051e548c86b28e94de81a98033d651 (diff)
downloadfsf-binutils-gdb-961ccde634c48fe95887cbfc5e3d15debc4d4818.zip
fsf-binutils-gdb-961ccde634c48fe95887cbfc5e3d15debc4d4818.tar.gz
fsf-binutils-gdb-961ccde634c48fe95887cbfc5e3d15debc4d4818.tar.bz2
Bugfix for length==0 case.
Diffstat (limited to 'gdb/c-lang.c')
-rw-r--r--gdb/c-lang.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/c-lang.c b/gdb/c-lang.c
index bfa03d0..b96dc1e 100644
--- a/gdb/c-lang.c
+++ b/gdb/c-lang.c
@@ -111,7 +111,7 @@ c_printstr (stream, string, length, force_ellipses)
/* If the string was not truncated due to `set print elements', and
the last byte of it is a null, we don't print that, in traditional C
style. */
- if ((!force_ellipses) && string[length-1] == '\0')
+ if ((!force_ellipses) && length > 0 && string[length-1] == '\0')
length--;
if (length == 0)