@@ -568,16 +568,18 @@ void deviceid_decode_dest (char *dest, char *device, size_t device_size)
568
568
*
569
569
* Inputs: comment - MIC-E comment that might have vendor/model encoded as
570
570
* a prefix and/or suffix.
571
+ * Any trailing CR has already been removed.
571
572
*
572
573
* trimmed_size - Amount of space available for result to avoid buffer overflow.
573
574
*
574
575
* device_size - Amount of space available for result to avoid buffer overflow.
575
576
*
576
577
* Outputs: trimmed - Final comment with device vendor/model removed.
578
+ * This would include any altitude.
577
579
*
578
580
* device - Vendor and model.
579
581
*
580
- * Description: This has a tortured history.
582
+ * Description: MIC-E device identification has a tortured history.
581
583
*
582
584
* The Kenwood TH-D7A put ">" at the beginning of the comment.
583
585
* The Kenwood TM-D700 put "]" at the beginning of the comment.
@@ -593,7 +595,9 @@ void deviceid_decode_dest (char *dest, char *device, size_t device_size)
593
595
*
594
596
* References: http://www.aprs.org/aprs12/mic-e-types.txt
595
597
* http://www.aprs.org/aprs12/mic-e-examples.txt
596
- *
598
+ * https://github.com/wb2osz/aprsspec containing:
599
+ * APRS Protocol Specification 1.2
600
+ * Understanding APRS Packets
597
601
*------------------------------------------------------------------*/
598
602
599
603
// The strncmp documentation doesn't mention behavior if length is zero.
@@ -612,6 +616,10 @@ static inline int strncmp_z (char *a, char *b, size_t len)
612
616
void deviceid_decode_mice (char * comment , char * trimmed , size_t trimmed_size , char * device , size_t device_size )
613
617
{
614
618
strlcpy (device , "UNKNOWN vendor/model" , device_size );
619
+ strlcpy (trimmed , comment , sizeof (trimmed ));
620
+ if (strlen (comment ) < 1 ) {
621
+ return ;
622
+ }
615
623
616
624
if (ptocalls == NULL ) {
617
625
text_color_set (DW_COLOR_ERROR );
@@ -663,6 +671,7 @@ void deviceid_decode_mice (char *comment, char *trimmed, size_t trimmed_size, ch
663
671
// Not found.
664
672
665
673
strlcpy (device , "UNKNOWN vendor/model" , device_size );
674
+ strlcpy (trimmed , comment , sizeof (trimmed ));
666
675
667
676
} // end deviceid_decode_mice
668
677
0 commit comments