FreeCalypso > hg > freecalypso-tools
diff rvinterf/lowlevel/format_fc.c @ 927:4e243402f453
rvinterf/lowlevel: use libprint for backslash-escape output
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Tue, 23 May 2023 03:59:42 +0000 |
parents | e7502631a0f9 |
children | 65953c172f24 |
line wrap: on
line diff
--- a/rvinterf/lowlevel/format_fc.c Tue May 23 03:47:46 2023 +0000 +++ b/rvinterf/lowlevel/format_fc.c Tue May 23 03:59:42 2023 +0000 @@ -18,58 +18,16 @@ void print_ati_output() { - int i, c; - char *dp; - - dp = fmtbuf; - strcpy(dp, "ATI: "); - dp += 5; - for (i = 1; i < rxpkt_len; i++) { - c = rxpkt[i]; - if (c & 0x80) { - *dp++ = 'M'; - *dp++ = '-'; - c &= 0x7F; - } - if (c < 0x20) { - *dp++ = '^'; - *dp++ = c + '@'; - } else if (c == 0x7F) { - *dp++ = '^'; - *dp++ = '?'; - } else - *dp++ = c; - } - *dp = '\0'; + strcpy(fmtbuf, "ATI: "); + safe_print_trace(rxpkt + 1, rxpkt_len - 1, fmtbuf + 5); output_line(fmtbuf); } void print_fc_lld_msg() { - int i, c; - char *dp; - - dp = fmtbuf; - strcpy(dp, "LLD: "); - dp += 5; - for (i = 1; i < rxpkt_len; i++) { - c = rxpkt[i]; - if (c & 0x80) { - *dp++ = 'M'; - *dp++ = '-'; - c &= 0x7F; - } - if (c < 0x20) { - *dp++ = '^'; - *dp++ = c + '@'; - } else if (c == 0x7F) { - *dp++ = '^'; - *dp++ = '?'; - } else - *dp++ = c; - } - *dp = '\0'; + strcpy(fmtbuf, "LLD: "); + safe_print_trace(rxpkt + 1, rxpkt_len - 1, fmtbuf + 5); output_line(fmtbuf); }