* Rename remote-es1800.c to remote-es.c
[deliverable/binutils-gdb.git] / gdb / c-lang.c
index bfa03d0a590f080a4358f295a1b3e2d38f867c0d..b96dc1ef950739183f67683cfc983a52bc94fd90 100644 (file)
@@ -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)
This page took 0.023342 seconds and 4 git commands to generate.