# HG changeset patch # User Mychaela Falconia # Date 1684821368 0 # Node ID ab771ce34fac8de223550bd8c41c517ef9da227a # Parent 65953c172f243b3c13cc6c515933ef29118a345b rvinterf/lowlevel/format.c: get rid of static fmtbuf diff -r 65953c172f24 -r ab771ce34fac rvinterf/lowlevel/format.c --- a/rvinterf/lowlevel/format.c Tue May 23 05:23:19 2023 +0000 +++ b/rvinterf/lowlevel/format.c Tue May 23 05:56:08 2023 +0000 @@ -16,15 +16,13 @@ extern void output_cont(); -static char fmtbuf[MAX_PKT_FROM_TARGET*8]; /* size it generously */ - void print_rv_trace() { int i; - char *dp; + char fmtbuf[MAX_PKT_FROM_TARGET*4]; + char *dp = fmtbuf; - dp = fmtbuf; strcpy(dp, "RV "); dp += 3; /* the SWE static ID is sent MSB first */ @@ -43,9 +41,9 @@ print_l1_trace() { int i, c; - char *dp; + char fmtbuf[MAX_PKT_FROM_TARGET*4+1]; + char *dp = fmtbuf; - dp = fmtbuf; strcpy(dp, "L1: "); dp += 4; for (i = 1; i < rxpkt_len; i++) { @@ -95,6 +93,8 @@ void print_g23_trace() { + char fmtbuf[MAX_PKT_FROM_TARGET*8]; /* size it generously */ + /* messy logic factored out into libg23 */ format_g23_packet(rxpkt, (int)rxpkt_len, fmtbuf); output_line(fmtbuf);