aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver/remote-utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/gdbserver/remote-utils.c')
-rw-r--r--gdb/gdbserver/remote-utils.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gdb/gdbserver/remote-utils.c b/gdb/gdbserver/remote-utils.c
index b835175..8fd7c4a 100644
--- a/gdb/gdbserver/remote-utils.c
+++ b/gdb/gdbserver/remote-utils.c
@@ -1558,10 +1558,11 @@ relocate_instruction (CORE_ADDR *to, CORE_ADDR oldloc)
void
monitor_output (const char *msg)
{
- char *buf = xmalloc (strlen (msg) * 2 + 2);
+ int len = strlen (msg);
+ char *buf = xmalloc (len * 2 + 2);
buf[0] = 'O';
- hexify (buf + 1, msg, 0);
+ hexify (buf + 1, msg, len);
putpkt (buf);
free (buf);