mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-28 23:39:35 +08:00
Bugfix for length==0 case.
This commit is contained in:
@ -1,5 +1,7 @@
|
|||||||
Thu Feb 18 04:10:06 1993 John Gilmore (gnu@cygnus.com)
|
Thu Feb 18 04:10:06 1993 John Gilmore (gnu@cygnus.com)
|
||||||
|
|
||||||
|
* c-lang.c (c_printstr): Bugfix for length==0 case.
|
||||||
|
|
||||||
* c-lang.c (c_printstr): If a C string ends in a null, don't
|
* c-lang.c (c_printstr): If a C string ends in a null, don't
|
||||||
print the null.
|
print the null.
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ c_printstr (stream, string, length, force_ellipses)
|
|||||||
/* If the string was not truncated due to `set print elements', and
|
/* 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
|
the last byte of it is a null, we don't print that, in traditional C
|
||||||
style. */
|
style. */
|
||||||
if ((!force_ellipses) && string[length-1] == '\0')
|
if ((!force_ellipses) && length > 0 && string[length-1] == '\0')
|
||||||
length--;
|
length--;
|
||||||
|
|
||||||
if (length == 0)
|
if (length == 0)
|
||||||
|
Reference in New Issue
Block a user