From d9d6bb425769c7cd52e1426c5f508abe8776060d Mon Sep 17 00:00:00 2001 From: wb2osz Date: Fri, 8 Nov 2019 20:36:10 -0500 Subject: [PATCH] Better error message for unprintable data type indicator. --- decode_aprs.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/decode_aprs.c b/decode_aprs.c index 729fb75..167ad5d 100644 --- a/decode_aprs.c +++ b/decode_aprs.c @@ -164,7 +164,12 @@ void decode_aprs (decode_aprs_t *A, packet_t pp, int quiet) A->g_quiet = quiet; - snprintf (A->g_msg_type, sizeof(A->g_msg_type), "Unknown APRS Data Type Indicator \"%c\"", *pinfo); + if (isprint(*pinfo)) { + snprintf (A->g_msg_type, sizeof(A->g_msg_type), "Unknown APRS Data Type Indicator \"%c\"", *pinfo); + } + else { + snprintf (A->g_msg_type, sizeof(A->g_msg_type), "ERROR!!! Unknown APRS Data Type Indicator: unprintable 0x%02x", *pinfo); + } A->g_symbol_table = '/'; /* Default to primary table. */ A->g_symbol_code = ' '; /* What should we have for default symbol? */