diff options
author | Jim Kingdon <jkingdon@engr.sgi.com> | 1994-03-13 18:37:27 +0000 |
---|---|---|
committer | Jim Kingdon <jkingdon@engr.sgi.com> | 1994-03-13 18:37:27 +0000 |
commit | 79f3d5862914001d44970359a55dd1691714593c (patch) | |
tree | 3b04653ae71782ee79d15f5adc038f641c21972a | |
parent | 8eb795981e48f42178232c27c55ecc8e63bcb7e0 (diff) | |
download | gdb-79f3d5862914001d44970359a55dd1691714593c.zip gdb-79f3d5862914001d44970359a55dd1691714593c.tar.gz gdb-79f3d5862914001d44970359a55dd1691714593c.tar.bz2 |
* valprint.c (val_print_string): Ignore error if the error
happened after a terminating '\0'.
* c-valprint.c (c_val_print): Never add 1 to return value from
val_print_string; just return what it returns.
-rw-r--r-- | gdb/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/c-valprint.c | 7 |
2 files changed, 10 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index aac0a1b..21ee77e 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,11 @@ Sun Mar 13 09:45:51 1994 Jim Kingdon (kingdon@lioth.cygnus.com) + * valprint.c (val_print_string): Ignore error if the error + happened after a terminating '\0'. + + * c-valprint.c (c_val_print): Never add 1 to return value from + val_print_string; just return what it returns. + * target.h (enum target_signal): Add TARGET_SIGNAL_FIRST, for looping through all of the enums. * infrun.c (signals_info): Use it. diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c index aa0cd9d..905c313 100644 --- a/gdb/c-valprint.c +++ b/gdb/c-valprint.c @@ -231,9 +231,10 @@ c_val_print (type, valaddr, address, stream, format, deref_ref, recurse, } } - /* Return number of characters printed, plus one for the - terminating null if we have "reached the end". */ - return (i + (print_max && i != print_max)); + /* Return number of characters printed, including the terminating + '\0' if we reached the end. val_print_string takes care including + the terminating '\0' if necessary. */ + return i; } break; |