Skip to content

Commit f4b30ea

Browse files
zsxOldes
authored andcommitted
ATRONIX: Fix: TRACE ON shows bizarre parse behavior
Terminate string with '\0' fixes: Oldes/Rebol-issues#2150 (cherry picked from commit 25d35a9)
1 parent f913b27 commit f4b30ea

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/core/c-do.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,10 @@ void Trace_Arg(REBINT num, REBVAL *arg, REBVAL *path)
289289
{
290290
static char tracebuf[64];
291291
int depth;
292+
int len = MIN(60, limit);
292293
CHECK_DEPTH(depth);
293-
memcpy(tracebuf, str, MIN(60, limit));
294+
memcpy(tracebuf, str, len);
295+
tracebuf[len] = '\0';
294296
Debug_Fmt(BOOT_STR(RS_TRACE,n), tracebuf);
295297
}
296298

0 commit comments

Comments
 (0)