From 6eef98a147fc78410f046607dfc8608149a79b01 Mon Sep 17 00:00:00 2001 From: msnyder Date: Mon, 24 Jul 2000 18:13:27 +0000 Subject: [PATCH] * printcmd.c (printf_command): Guard against 0-length string. ---------------------------------------------------------------------- --- gdb/printcmd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gdb/printcmd.c b/gdb/printcmd.c index 629af99dc4..45baef2ba6 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -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); -- 2.11.0