mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-28 04:25:10 +08:00
* printcmd.c (printf_command): Guard against 0-length string.
----------------------------------------------------------------------
This commit is contained in:
parent
39da812840
commit
7b92f6e1a2
@ -2331,7 +2331,8 @@ printf_command (arg, from_tty)
|
||||
|
||||
/* Copy the string contents into a string inside GDB. */
|
||||
str = (char *) alloca (j + 1);
|
||||
read_memory (tem, str, j);
|
||||
if (j != 0)
|
||||
read_memory (tem, str, j);
|
||||
str[j] = 0;
|
||||
|
||||
printf_filtered (current_substring, str);
|
||||
|
Loading…
Reference in New Issue
Block a user