summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/src/debug.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/src/debug.c b/src/src/debug.c
index 7b9be057b..f71146220 100644
--- a/src/src/debug.c
+++ b/src/src/debug.c
@@ -322,7 +322,7 @@ if (debug_ptr[-1] == '\n')
if (debug_pretrigger_buf)
{
- int needed = Ustrlen(debug_buffer), avail;
+ int needed = Ustrlen(debug_buffer)+1, avail;
char c;
if (needed > debug_pretrigger_bsize)
@@ -343,6 +343,7 @@ if (debug_ptr[-1] == '\n')
}
while (c && c != '\n' && pretrigger_readoff != pretrigger_writeoff);
+ needed--;
for (int i = 0; needed; i++, needed--)
{
debug_pretrigger_buf[pretrigger_writeoff] = debug_buffer[i];