aboutsummaryrefslogtreecommitdiff
path: root/gdb/printcmd.c
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@vmware.com>2000-07-24 18:13:27 +0000
committerMichael Snyder <msnyder@vmware.com>2000-07-24 18:13:27 +0000
commit7b92f6e1a2aa490095178c3036a3708472e466e9 (patch)
tree4221004d7d41d814d89ed6a2994f13ce96e1e718 /gdb/printcmd.c
parent39da8128405ba3c241ff51cf54cff7f82f6674ba (diff)
downloadgdb-7b92f6e1a2aa490095178c3036a3708472e466e9.zip
gdb-7b92f6e1a2aa490095178c3036a3708472e466e9.tar.gz
gdb-7b92f6e1a2aa490095178c3036a3708472e466e9.tar.bz2
* printcmd.c (printf_command): Guard against 0-length string.
----------------------------------------------------------------------
Diffstat (limited to 'gdb/printcmd.c')
-rw-r--r--gdb/printcmd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gdb/printcmd.c b/gdb/printcmd.c
index 629af99..45baef2 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);