OSDN Git Service

* printcmd.c (printf_command): Guard against 0-length string.
authormsnyder <msnyder>
Mon, 24 Jul 2000 18:13:27 +0000 (18:13 +0000)
committermsnyder <msnyder>
Mon, 24 Jul 2000 18:13:27 +0000 (18:13 +0000)
----------------------------------------------------------------------

gdb/printcmd.c

index 629af99..45baef2 100644 (file)
@@ -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);