summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2022-02-05 22:32:12 +0000
committerJeremy Harris <jgh146exb@wizmail.org>2022-02-05 22:32:12 +0000
commit70918f02eecc64d5033b9831a393f2eca3c4709d (patch)
tree0620c65439ba631f891aa9c866fa5205123e6b52 /src
parent19fdbfb4a2b6ca4a6a96ef52be848f0a23e2414f (diff)
Debug: handle exact-fill of pretrigger buffer
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];