From 44f576cb733b6394f1500058631bc5d25754bc90 Mon Sep 17 00:00:00 2001 From: wb2osz Date: Tue, 22 Oct 2024 23:38:38 +0100 Subject: [PATCH] MIC-E improvements --- src/decode_aprs.c | 2 +- src/deviceid.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/decode_aprs.c b/src/decode_aprs.c index 81ae9bf..acfed6b 100644 --- a/src/decode_aprs.c +++ b/src/decode_aprs.c @@ -1424,7 +1424,7 @@ static void aprs_mic_e (decode_aprs_t *A, packet_t pp, unsigned char *info, int if (ilen < sizeof(struct aprs_mic_e_s)) { if ( ! A->g_quiet) { text_color_set(DW_COLOR_ERROR); - dw_printf("MIC-E format must have at least %d characters in the information part.\n", sizeof(struct aprs_mic_e_s)); + dw_printf("MIC-E format must have at least %d characters in the information part.\n", (int)(sizeof(struct aprs_mic_e_s))); } return; } diff --git a/src/deviceid.c b/src/deviceid.c index 036c7b0..49b9b34 100644 --- a/src/deviceid.c +++ b/src/deviceid.c @@ -620,7 +620,7 @@ static inline int strncmp_z (char *a, char *b, size_t len) void deviceid_decode_mice (char *comment, char *trimmed, size_t trimmed_size, char *device, size_t device_size) { strlcpy (device, "UNKNOWN vendor/model", device_size); - strlcpy (trimmed, comment, sizeof(trimmed)); + strlcpy (trimmed, comment, trimmed_size); if (strlen(comment) < 1) { return; } @@ -675,7 +675,7 @@ void deviceid_decode_mice (char *comment, char *trimmed, size_t trimmed_size, ch // Not found. strlcpy (device, "UNKNOWN vendor/model", device_size); - strlcpy (trimmed, comment, sizeof(trimmed)); + strlcpy (trimmed, comment, trimmed_size); } // end deviceid_decode_mice