aboutsummaryrefslogtreecommitdiff
path: root/gdb/c-valprint.c
diff options
context:
space:
mode:
authorJim Kingdon <jkingdon@engr.sgi.com>1994-03-13 18:37:27 +0000
committerJim Kingdon <jkingdon@engr.sgi.com>1994-03-13 18:37:27 +0000
commit79f3d5862914001d44970359a55dd1691714593c (patch)
tree3b04653ae71782ee79d15f5adc038f641c21972a /gdb/c-valprint.c
parent8eb795981e48f42178232c27c55ecc8e63bcb7e0 (diff)
downloadgdb-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.
Diffstat (limited to 'gdb/c-valprint.c')
-rw-r--r--gdb/c-valprint.c7
1 files changed, 4 insertions, 3 deletions
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;