* valprint.c (val_print_string): Ignore error if the error
authorJim Kingdon <jkingdon@engr.sgi.com>
Sun, 13 Mar 1994 18:37:27 +0000 (18:37 +0000)
committerJim Kingdon <jkingdon@engr.sgi.com>
Sun, 13 Mar 1994 18:37:27 +0000 (18:37 +0000)
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.

gdb/ChangeLog
gdb/c-valprint.c

index aac0a1bf503dfa71414c7917eb0d6a55be8ae3cd..21ee77e4ff36afd02e9b72a37d47e2da484bd52d 100644 (file)
@@ -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.
index aa0cd9db31b43480ac5bf344979bedc300ff0413..905c313613a769fa68650bba22f0d441f29faf1a 100644 (file)
@@ -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;
 
This page took 0.0275 seconds and 4 git commands to generate.