Skip to content

Commit 0bd31ae

Browse files
committed
Clean up warnings.
1 parent e108147 commit 0bd31ae

File tree

4 files changed

+52
-50
lines changed

4 files changed

+52
-50
lines changed

src/appserver.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,15 +491,19 @@ void agw_cb_D_connected_data (int chan, char *call_from, char *call_to, int data
491491
// who - list people currently logged in.
492492

493493
int n;
494-
char greeting[80];
494+
char greeting[128];
495495

496496
snprintf (greeting, sizeof(greeting), "Session Channel User Since\r");
497497
agwlib_D_send_connected_data (chan, 0xF0, mycall, call_from, strlen(greeting), greeting);
498498

499499
for (n = 0; n < MAX_SESSIONS; n++) {
500500
if (session[n].client_addr[0]) {
501+
// I think compiler is confused. It says up to 520 characters can be written.
502+
#pragma GCC diagnostic push
503+
#pragma GCC diagnostic ignored "-Wformat-truncation"
501504
snprintf (greeting, sizeof(greeting), " %2d %d %-9s [time later]\r",
502505
n, session[n].channel, session[n].client_addr);
506+
#pragma GCC diagnostic pop
503507
agwlib_D_send_connected_data (chan, 0xF0, mycall, call_from, strlen(greeting), greeting);
504508
}
505509
}

src/decode_aprs.c

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,10 @@ void decode_aprs (decode_aprs_t *A, packet_t pp, int quiet, int third_party)
174174
A->g_quiet = quiet;
175175

176176
if (isprint(*pinfo)) {
177-
snprintf (A->g_msg_type, sizeof(A->g_msg_type), "Unknown APRS Data Type Indicator \"%c\"", *pinfo);
177+
snprintf (A->g_data_type_desc, sizeof(A->g_data_type_desc), "Unknown APRS Data Type Indicator \"%c\"", *pinfo);
178178
}
179179
else {
180-
snprintf (A->g_msg_type, sizeof(A->g_msg_type), "ERROR!!! Unknown APRS Data Type Indicator: unprintable 0x%02x", *pinfo);
180+
snprintf (A->g_data_type_desc, sizeof(A->g_data_type_desc), "ERROR!!! Unknown APRS Data Type Indicator: unprintable 0x%02x", *pinfo);
181181
}
182182

183183
A->g_symbol_table = '/'; /* Default to primary table. */
@@ -225,7 +225,7 @@ void decode_aprs (decode_aprs_t *A, packet_t pp, int quiet, int third_party)
225225
return;
226226
}
227227
else {
228-
strlcpy (A->g_msg_type, "Third Party Header: Unable to parse payload.", sizeof(A->g_msg_type));
228+
strlcpy (A->g_data_type_desc, "Third Party Header: Unable to parse payload.", sizeof(A->g_data_type_desc));
229229
ax25_get_addr_with_ssid (pp, AX25_SOURCE, A->g_src);
230230
ax25_get_addr_with_ssid (pp, AX25_DESTINATION, A->g_dest);
231231
}
@@ -459,7 +459,7 @@ void decode_aprs_print (decode_aprs_t *A) {
459459
* - mic-e status
460460
* - power/height/gain, range
461461
*/
462-
strlcpy (stemp, A->g_msg_type, sizeof(stemp));
462+
strlcpy (stemp, A->g_data_type_desc, sizeof(stemp));
463463

464464
//dw_printf ("DEBUG decode_aprs_print stemp1=%s\n", stemp);
465465

@@ -799,7 +799,7 @@ static void aprs_ll_pos (decode_aprs_t *A, unsigned char *info, int ilen)
799799
} *q;
800800

801801

802-
strlcpy (A->g_msg_type, "Position", sizeof(A->g_msg_type));
802+
strlcpy (A->g_data_type_desc, "Position", sizeof(A->g_data_type_desc));
803803

804804
p = (struct aprs_ll_pos_s *)info;
805805
q = (struct aprs_compressed_pos_s *)info;
@@ -813,7 +813,7 @@ static void aprs_ll_pos (decode_aprs_t *A, unsigned char *info, int ilen)
813813
/* In this case, we expect 7 byte "data extension" */
814814
/* for the wind direction and speed. */
815815

816-
strlcpy (A->g_msg_type, "Weather Report", sizeof(A->g_msg_type));
816+
strlcpy (A->g_data_type_desc, "Weather Report", sizeof(A->g_data_type_desc));
817817
weather_data (A, p->comment, TRUE);
818818
}
819819
else {
@@ -832,7 +832,7 @@ static void aprs_ll_pos (decode_aprs_t *A, unsigned char *info, int ilen)
832832
/* compressed data so we don't expect a 7 byte "data */
833833
/* extension" for them. */
834834

835-
strlcpy (A->g_msg_type, "Weather Report", sizeof(A->g_msg_type));
835+
strlcpy (A->g_data_type_desc, "Weather Report", sizeof(A->g_data_type_desc));
836836
weather_data (A, q->comment, FALSE);
837837
}
838838
else {
@@ -902,7 +902,7 @@ static void aprs_ll_pos_time (decode_aprs_t *A, unsigned char *info, int ilen)
902902
} *q;
903903

904904

905-
strlcpy (A->g_msg_type, "Position with time", sizeof(A->g_msg_type));
905+
strlcpy (A->g_data_type_desc, "Position with time", sizeof(A->g_data_type_desc));
906906

907907
time_t ts = 0;
908908

@@ -921,7 +921,7 @@ static void aprs_ll_pos_time (decode_aprs_t *A, unsigned char *info, int ilen)
921921
/* In this case, we expect 7 byte "data extension" */
922922
/* for the wind direction and speed. */
923923

924-
strlcpy (A->g_msg_type, "Weather Report", sizeof(A->g_msg_type));
924+
strlcpy (A->g_data_type_desc, "Weather Report", sizeof(A->g_data_type_desc));
925925
weather_data (A, p->comment, TRUE);
926926
}
927927
else {
@@ -942,7 +942,7 @@ static void aprs_ll_pos_time (decode_aprs_t *A, unsigned char *info, int ilen)
942942
/* compressed data so we don't expect a 7 byte "data */
943943
/* extension" for them. */
944944

945-
strlcpy (A->g_msg_type, "Weather Report", sizeof(A->g_msg_type));
945+
strlcpy (A->g_data_type_desc, "Weather Report", sizeof(A->g_data_type_desc));
946946
weather_data (A, q->comment, FALSE);
947947
}
948948
else {
@@ -997,7 +997,7 @@ static void aprs_raw_nmea (decode_aprs_t *A, unsigned char *info, int ilen)
997997

998998
(void) dwgpsnmea_gprmc ((char*)info, A->g_quiet, &(A->g_lat), &(A->g_lon), &speed_knots, &(A->g_course));
999999
A->g_speed_mph = DW_KNOTS_TO_MPH(speed_knots);
1000-
strlcpy (A->g_msg_type, "Raw GPS data", sizeof(A->g_msg_type));
1000+
strlcpy (A->g_data_type_desc, "Raw GPS data", sizeof(A->g_data_type_desc));
10011001
}
10021002
else if (strncmp((char*)info, "$GPGGA,", 7) == 0 ||
10031003
strncmp((char*)info, "$GNGGA,", 7) == 0)
@@ -1007,7 +1007,7 @@ static void aprs_raw_nmea (decode_aprs_t *A, unsigned char *info, int ilen)
10071007

10081008
(void) dwgpsnmea_gpgga ((char*)info, A->g_quiet, &(A->g_lat), &(A->g_lon), &alt_meters, &num_sat);
10091009
A->g_altitude_ft = DW_METERS_TO_FEET(alt_meters);
1010-
strlcpy (A->g_msg_type, "Raw GPS data", sizeof(A->g_msg_type));
1010+
strlcpy (A->g_data_type_desc, "Raw GPS data", sizeof(A->g_data_type_desc));
10111011
}
10121012

10131013
// TODO (low): add a few other sentence types.
@@ -1184,7 +1184,7 @@ static void aprs_mic_e (decode_aprs_t *A, packet_t pp, unsigned char *info, int
11841184
const char *cust_text[8] = {"Emergency", "Custom-6", "Custom-5", "Custom-4", "Custom-3", "Custom-2", "Custom-1", "Custom-0" };
11851185
unsigned char *pfirst, *plast;
11861186

1187-
strlcpy (A->g_msg_type, "MIC-E", sizeof(A->g_msg_type));
1187+
strlcpy (A->g_data_type_desc, "MIC-E", sizeof(A->g_data_type_desc));
11881188

11891189
p = (struct aprs_mic_e_s *)info;
11901190

@@ -1540,7 +1540,7 @@ static void aprs_mic_e (decode_aprs_t *A, packet_t pp, unsigned char *info, int
15401540
* ilen - Information field length.
15411541
* quiet - suppress error messages.
15421542
*
1543-
* Outputs: A->g_msg_type Text description for screen display.
1543+
* Outputs: A->g_data_type_desc Text description for screen display.
15441544
*
15451545
* A->g_addressee To whom is it addressed.
15461546
* Could be a specific station, alias, bulletin, etc.
@@ -1600,7 +1600,7 @@ static void aprs_message (decode_aprs_t *A, unsigned char *info, int ilen, int q
16001600

16011601
p = (struct aprs_message_s *)info;
16021602

1603-
strlcpy (A->g_msg_type, "APRS Message", sizeof(A->g_msg_type));
1603+
strlcpy (A->g_data_type_desc, "APRS Message", sizeof(A->g_data_type_desc));
16041604
A->g_message_subtype = message_subtype_message; /* until found otherwise */
16051605

16061606
if (ilen < 11) {
@@ -1678,22 +1678,22 @@ static void aprs_message (decode_aprs_t *A, unsigned char *info, int ilen, int q
16781678
*/
16791679

16801680
if (strncmp(p->message,"PARM.",5) == 0) {
1681-
snprintf (A->g_msg_type, sizeof(A->g_msg_type), "Telemetry Parameter Name Message for \"%s\"", addressee);
1681+
snprintf (A->g_data_type_desc, sizeof(A->g_data_type_desc), "Telemetry Parameter Name Message for \"%s\"", addressee);
16821682
A->g_message_subtype = message_subtype_telem_parm;
16831683
telemetry_name_message (addressee, p->message+5);
16841684
}
16851685
else if (strncmp(p->message,"UNIT.",5) == 0) {
1686-
snprintf (A->g_msg_type, sizeof(A->g_msg_type), "Telemetry Unit/Label Message for \"%s\"", addressee);
1686+
snprintf (A->g_data_type_desc, sizeof(A->g_data_type_desc), "Telemetry Unit/Label Message for \"%s\"", addressee);
16871687
A->g_message_subtype = message_subtype_telem_unit;
16881688
telemetry_unit_label_message (addressee, p->message+5);
16891689
}
16901690
else if (strncmp(p->message,"EQNS.",5) == 0) {
1691-
snprintf (A->g_msg_type, sizeof(A->g_msg_type), "Telemetry Equation Coefficients Message for \"%s\"", addressee);
1691+
snprintf (A->g_data_type_desc, sizeof(A->g_data_type_desc), "Telemetry Equation Coefficients Message for \"%s\"", addressee);
16921692
A->g_message_subtype = message_subtype_telem_eqns;
16931693
telemetry_coefficents_message (addressee, p->message+5, quiet);
16941694
}
16951695
else if (strncmp(p->message,"BITS.",5) == 0) {
1696-
snprintf (A->g_msg_type, sizeof(A->g_msg_type), "Telemetry Bit Sense/Project Name Message for \"%s\"", addressee);
1696+
snprintf (A->g_data_type_desc, sizeof(A->g_data_type_desc), "Telemetry Bit Sense/Project Name Message for \"%s\"", addressee);
16971697
A->g_message_subtype = message_subtype_telem_bits;
16981698
telemetry_bit_sense_message (addressee, p->message+5, quiet);
16991699
}
@@ -1704,7 +1704,7 @@ static void aprs_message (decode_aprs_t *A, unsigned char *info, int ilen, int q
17041704

17051705
else if (p->message[0] == '?') {
17061706

1707-
strlcpy (A->g_msg_type, "Directed Station Query", sizeof(A->g_msg_type));
1707+
strlcpy (A->g_data_type_desc, "Directed Station Query", sizeof(A->g_data_type_desc));
17081708
A->g_message_subtype = message_subtype_directed_query;
17091709

17101710
aprs_directed_station_query (A, addressee, p->message+1, quiet);
@@ -1723,7 +1723,7 @@ static void aprs_message (decode_aprs_t *A, unsigned char *info, int ilen, int q
17231723
dw_printf("ERROR: Message number is missing after \"ack\".\n");
17241724
}
17251725
if (strlen(A->g_message_number) >= 3 && A->g_message_number[2] == '}') A->g_message_number[2] = '\0';
1726-
snprintf (A->g_msg_type, sizeof(A->g_msg_type), "\"%s\" ACKnowledged message number \"%s\" from \"%s\"", A->g_src, A->g_message_number, addressee);
1726+
snprintf (A->g_data_type_desc, sizeof(A->g_data_type_desc), "\"%s\" ACKnowledged message number \"%s\" from \"%s\"", A->g_src, A->g_message_number, addressee);
17271727
A->g_message_subtype = message_subtype_ack;
17281728
}
17291729
else if (strncasecmp(p->message,"rej",3) == 0) {
@@ -1737,7 +1737,7 @@ static void aprs_message (decode_aprs_t *A, unsigned char *info, int ilen, int q
17371737
dw_printf("ERROR: Message number is missing after \"rej\".\n");
17381738
}
17391739
if (strlen(A->g_message_number) >= 3 && A->g_message_number[2] == '}') A->g_message_number[2] = '\0';
1740-
snprintf (A->g_msg_type, sizeof(A->g_msg_type), "\"%s\" REJected message number \"%s\" from \"%s\"", A->g_src, A->g_message_number, addressee);
1740+
snprintf (A->g_data_type_desc, sizeof(A->g_data_type_desc), "\"%s\" REJected message number \"%s\" from \"%s\"", A->g_src, A->g_message_number, addressee);
17411741
A->g_message_subtype = message_subtype_ack;
17421742
}
17431743

@@ -1778,16 +1778,16 @@ static void aprs_message (decode_aprs_t *A, unsigned char *info, int ilen, int q
17781778

17791779
if (strlen(ack) > 0) {
17801780
// With ACK. Message number should be 2 characters.
1781-
snprintf (A->g_msg_type, sizeof(A->g_msg_type), "APRS Message, number \"%s\", from \"%s\" to \"%s\", with ACK for \"%s\"", A->g_message_number, A->g_src, addressee, ack);
1781+
snprintf (A->g_data_type_desc, sizeof(A->g_data_type_desc), "APRS Message, number \"%s\", from \"%s\" to \"%s\", with ACK for \"%s\"", A->g_message_number, A->g_src, addressee, ack);
17821782
}
17831783
else {
17841784
// Message number can be 1-5 characters.
1785-
snprintf (A->g_msg_type, sizeof(A->g_msg_type), "APRS Message, number \"%s\", from \"%s\" to \"%s\"", A->g_message_number, A->g_src, addressee);
1785+
snprintf (A->g_data_type_desc, sizeof(A->g_data_type_desc), "APRS Message, number \"%s\", from \"%s\" to \"%s\"", A->g_message_number, A->g_src, addressee);
17861786
}
17871787
}
17881788
else {
17891789
// No message number.
1790-
snprintf (A->g_msg_type, sizeof(A->g_msg_type), "APRS Message, with no number, from \"%s\" to \"%s\"", A->g_src, addressee);
1790+
snprintf (A->g_data_type_desc, sizeof(A->g_data_type_desc), "APRS Message, with no number, from \"%s\" to \"%s\"", A->g_src, addressee);
17911791
}
17921792

17931793
A->g_message_subtype = message_subtype_message;
@@ -1866,11 +1866,11 @@ static void aprs_object (decode_aprs_t *A, unsigned char *info, int ilen)
18661866
}
18671867

18681868
if (p->live_killed == '*')
1869-
strlcpy (A->g_msg_type, "Object", sizeof(A->g_msg_type));
1869+
strlcpy (A->g_data_type_desc, "Object", sizeof(A->g_data_type_desc));
18701870
else if (p->live_killed == '_')
1871-
strlcpy (A->g_msg_type, "Killed Object", sizeof(A->g_msg_type));
1871+
strlcpy (A->g_data_type_desc, "Killed Object", sizeof(A->g_data_type_desc));
18721872
else
1873-
strlcpy (A->g_msg_type, "Object - invalid live/killed", sizeof(A->g_msg_type));
1873+
strlcpy (A->g_data_type_desc, "Object - invalid live/killed", sizeof(A->g_data_type_desc));
18741874

18751875
ts = get_timestamp (A, p->time_stamp);
18761876

@@ -1883,7 +1883,7 @@ static void aprs_object (decode_aprs_t *A, unsigned char *info, int ilen)
18831883
/* In this case, we expect 7 byte "data extension" */
18841884
/* for the wind direction and speed. */
18851885

1886-
strlcpy (A->g_msg_type, "Weather Report with Object", sizeof(A->g_msg_type));
1886+
strlcpy (A->g_data_type_desc, "Weather Report with Object", sizeof(A->g_data_type_desc));
18871887
weather_data (A, p->comment, TRUE);
18881888
}
18891889
else {
@@ -1902,7 +1902,7 @@ static void aprs_object (decode_aprs_t *A, unsigned char *info, int ilen)
19021902
/* of weather report and object with compressed */
19031903
/* position. */
19041904

1905-
strlcpy (A->g_msg_type, "Weather Report with Object", sizeof(A->g_msg_type));
1905+
strlcpy (A->g_data_type_desc, "Weather Report with Object", sizeof(A->g_data_type_desc));
19061906
weather_data (A, q->comment, FALSE);
19071907
}
19081908
else {
@@ -1983,15 +1983,15 @@ static void aprs_item (decode_aprs_t *A, unsigned char *info, int ilen)
19831983
}
19841984

19851985
if (p->name[i] == '!')
1986-
strlcpy (A->g_msg_type, "Item", sizeof(A->g_msg_type));
1986+
strlcpy (A->g_data_type_desc, "Item", sizeof(A->g_data_type_desc));
19871987
else if (p->name[i] == '_')
1988-
strlcpy (A->g_msg_type, "Killed Item", sizeof(A->g_msg_type));
1988+
strlcpy (A->g_data_type_desc, "Killed Item", sizeof(A->g_data_type_desc));
19891989
else {
19901990
if ( ! A->g_quiet) {
19911991
text_color_set(DW_COLOR_ERROR);
19921992
dw_printf("Item name too long or not followed by ! or _.\n");
19931993
}
1994-
strlcpy (A->g_msg_type, "Object - invalid live/killed", sizeof(A->g_msg_type));
1994+
strlcpy (A->g_data_type_desc, "Object - invalid live/killed", sizeof(A->g_data_type_desc));
19951995
}
19961996

19971997
ppos = p->name + i + 1;
@@ -2035,7 +2035,7 @@ static void aprs_item (decode_aprs_t *A, unsigned char *info, int ilen)
20352035
static void aprs_station_capabilities (decode_aprs_t *A, char *info, int ilen)
20362036
{
20372037

2038-
strlcpy (A->g_msg_type, "Station Capabilities", sizeof(A->g_msg_type));
2038+
strlcpy (A->g_data_type_desc, "Station Capabilities", sizeof(A->g_data_type_desc));
20392039

20402040
// process_comment() not applicable here because it
20412041
// extracts information found in certain formats.
@@ -2122,7 +2122,7 @@ static void aprs_status_report (decode_aprs_t *A, char *info, int ilen)
21222122
} *ps;
21232123

21242124

2125-
strlcpy (A->g_msg_type, "Status Report", sizeof(A->g_msg_type));
2125+
strlcpy (A->g_data_type_desc, "Status Report", sizeof(A->g_data_type_desc));
21262126

21272127
pt = (struct aprs_status_time_s *)info;
21282128
pm4 = (struct aprs_status_m4_s *)info;
@@ -2303,7 +2303,7 @@ static void aprs_general_query (decode_aprs_t *A, char *info, int ilen, int quie
23032303
double lat, lon;
23042304
float radius;
23052305

2306-
strlcpy (A->g_msg_type, "General Query", sizeof(A->g_msg_type));
2306+
strlcpy (A->g_data_type_desc, "General Query", sizeof(A->g_data_type_desc));
23072307

23082308
/*
23092309
* First make a copy because we will modify it while parsing it.
@@ -2485,7 +2485,7 @@ static void aprs_directed_station_query (decode_aprs_t *A, char *addressee, char
24852485
static void aprs_telemetry (decode_aprs_t *A, char *info, int ilen, int quiet)
24862486
{
24872487

2488-
strlcpy (A->g_msg_type, "Telemetry", sizeof(A->g_msg_type));
2488+
strlcpy (A->g_data_type_desc, "Telemetry", sizeof(A->g_data_type_desc));
24892489

24902490
telemetry_data_original (A->g_src, info, quiet, A->g_telemetry, sizeof(A->g_telemetry), A->g_comment, sizeof(A->g_comment));
24912491

@@ -2522,7 +2522,7 @@ static void aprs_user_defined (decode_aprs_t *A, char *info, int ilen)
25222522
float knots, course;
25232523
float alt_meters;
25242524

2525-
ais_parse (info+3, 0, A->g_msg_type, sizeof(A->g_msg_type), A->g_name, sizeof(A->g_name),
2525+
ais_parse (info+3, 0, A->g_data_type_desc, sizeof(A->g_data_type_desc), A->g_name, sizeof(A->g_name),
25262526
&lat, &lon, &knots, &course, &alt_meters, &(A->g_symbol_table), &(A->g_symbol_code),
25272527
A->g_comment, sizeof(A->g_comment));
25282528

@@ -2534,10 +2534,10 @@ static void aprs_user_defined (decode_aprs_t *A, char *info, int ilen)
25342534
strcpy (A->g_mfr, "");
25352535
}
25362536
else if (strncmp(info, "{{", 2) == 0) {
2537-
snprintf (A->g_msg_type, sizeof(A->g_msg_type), "User-Defined Experimental");
2537+
snprintf (A->g_data_type_desc, sizeof(A->g_data_type_desc), "User-Defined Experimental");
25382538
}
25392539
else {
2540-
snprintf (A->g_msg_type, sizeof(A->g_msg_type), "User-Defined Data");
2540+
snprintf (A->g_data_type_desc, sizeof(A->g_data_type_desc), "User-Defined Data");
25412541
}
25422542

25432543
} /* end aprs_user_defined */
@@ -2562,7 +2562,7 @@ static void aprs_user_defined (decode_aprs_t *A, char *info, int ilen)
25622562
static void aprs_raw_touch_tone (decode_aprs_t *A, char *info, int ilen)
25632563
{
25642564

2565-
strlcpy (A->g_msg_type, "Raw Touch Tone Data", sizeof(A->g_msg_type));
2565+
strlcpy (A->g_data_type_desc, "Raw Touch Tone Data", sizeof(A->g_data_type_desc));
25662566

25672567
/* Just copy the info field without the message type. */
25682568

@@ -2593,7 +2593,7 @@ static void aprs_raw_touch_tone (decode_aprs_t *A, char *info, int ilen)
25932593
static void aprs_morse_code (decode_aprs_t *A, char *info, int ilen)
25942594
{
25952595

2596-
strlcpy (A->g_msg_type, "Morse Code Data", sizeof(A->g_msg_type));
2596+
strlcpy (A->g_data_type_desc, "Morse Code Data", sizeof(A->g_data_type_desc));
25972597

25982598
/* Just copy the info field without the message type. */
25992599

@@ -2633,7 +2633,7 @@ static void aprs_positionless_weather_report (decode_aprs_t *A, unsigned char *i
26332633
} *p;
26342634

26352635

2636-
strlcpy (A->g_msg_type, "Positionless Weather Report", sizeof(A->g_msg_type));
2636+
strlcpy (A->g_data_type_desc, "Positionless Weather Report", sizeof(A->g_data_type_desc));
26372637

26382638
//time_t ts = 0;
26392639

@@ -3038,7 +3038,7 @@ static void aprs_ultimeter (decode_aprs_t *A, char *info, int ilen)
30383038

30393039
int n;
30403040

3041-
strlcpy (A->g_msg_type, "Ultimeter", sizeof(A->g_msg_type));
3041+
strlcpy (A->g_data_type_desc, "Ultimeter", sizeof(A->g_data_type_desc));
30423042

30433043
if (*info == '$')
30443044
{

src/decode_aprs.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ typedef struct decode_aprs_s {
2828

2929
char g_dest[AX25_MAX_ADDR_LEN];
3030

31-
char g_msg_type[80]; /* APRS data type description. Telemetry descriptions get pretty long. */
32-
/* Putting msg in the name was a poor choice because */
33-
/* "message" has a specific meaning. Rename it to data_type someday. FIXME */
31+
char g_data_type_desc[100]; /* APRS data type description. Telemetry descriptions get pretty long. */
3432

3533
char g_symbol_table; /* The Symbol Table Identifier character selects one */
3634
/* of the two Symbol Tables, or it may be used as */

src/symbols.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ static const char *search_locations[] = {
319319
typedef struct new_sym_s {
320320
char overlay;
321321
char symbol;
322-
char description[NEW_SYM_DESC_LEN+1];
322+
char *description;
323323
} new_sym_t;
324324

325325
static new_sym_t *new_sym_ptr = NULL; /* Dynamically allocated array. */
@@ -418,7 +418,7 @@ void symbols_init (void)
418418
}
419419
new_sym_ptr[new_sym_len].overlay = stuff[COL1_OVERLAY];
420420
new_sym_ptr[new_sym_len].symbol = stuff[COL2_SYMBOL];
421-
strncpy(new_sym_ptr[new_sym_len].description, stuff+COL6_DESC, NEW_SYM_DESC_LEN);
421+
new_sym_ptr[new_sym_len].description = strdup(stuff+COL6_DESC);
422422
new_sym_len++;
423423
}
424424
}

0 commit comments

Comments
 (0)