aboutsummaryrefslogtreecommitdiff
path: root/monitor.c
diff options
context:
space:
mode:
Diffstat (limited to 'monitor.c')
-rw-r--r--monitor.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/monitor.c b/monitor.c
index 9a18639c4b..5edd39e922 100644
--- a/monitor.c
+++ b/monitor.c
@@ -82,8 +82,10 @@ void term_puts(const char *str)
c = *str++;
if (c == '\0')
break;
+ if (c == '\n')
+ term_outbuf[term_outbuf_index++] = '\r';
term_outbuf[term_outbuf_index++] = c;
- if (term_outbuf_index >= sizeof(term_outbuf) ||
+ if (term_outbuf_index >= (sizeof(term_outbuf) - 1) ||
c == '\n')
term_flush();
}