Skip to content

Commit 92a2097

Browse files
committed
New warnings for gcc 11.3.
1 parent 24a06ae commit 92a2097

File tree

4 files changed

+19
-18
lines changed

4 files changed

+19
-18
lines changed

src/ax25_link.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ typedef struct ax25_dlsm_s {
250250
// notifications about state changes.
251251

252252

253-
char addrs[AX25_MAX_REPEATERS][AX25_MAX_ADDR_LEN];
253+
char addrs[AX25_MAX_ADDRS][AX25_MAX_ADDR_LEN];
254254
// Up to 10 addresses, same order as in frame.
255255

256256
int num_addr; // Number of addresses. Should be in range 2 .. 10.
@@ -1657,7 +1657,7 @@ void dl_outstanding_frames_request (dlq_item_t *E)
16571657
// this is communicating with the client app, not over the air,
16581658
// so we don't need to worry about digipeaters.
16591659

1660-
char swapped[AX25_MAX_REPEATERS][AX25_MAX_ADDR_LEN];
1660+
char swapped[AX25_MAX_ADDRS][AX25_MAX_ADDR_LEN];
16611661
memset (swapped, 0, sizeof(swapped));
16621662
strlcpy (swapped[PEERCALL], E->addrs[OWNCALL], sizeof(swapped[PEERCALL]));
16631663
strlcpy (swapped[OWNCALL], E->addrs[PEERCALL], sizeof(swapped[OWNCALL]));

src/dlq.c

+5-6
Original file line numberDiff line numberDiff line change
@@ -728,8 +728,7 @@ void dlq_xmit_data_request (char addrs[AX25_MAX_ADDRS][AX25_MAX_ADDR_LEN], int n
728728
*
729729
* Purpose: Register callsigns that we will recognize for incoming connection requests.
730730
*
731-
* Inputs: addrs - Source (owncall), destination (peercall),
732-
* and possibly digipeaters.
731+
* Inputs: addr - Callsign to [un]register.
733732
*
734733
* chan - Channel, 0 is first.
735734
*
@@ -749,7 +748,7 @@ void dlq_xmit_data_request (char addrs[AX25_MAX_ADDRS][AX25_MAX_ADDR_LEN], int n
749748
*--------------------------------------------------------------------*/
750749

751750

752-
void dlq_register_callsign (char addr[AX25_MAX_ADDR_LEN], int chan, int client)
751+
void dlq_register_callsign (char *addr, int chan, int client)
753752
{
754753
struct dlq_item_s *pnew;
755754

@@ -773,7 +772,7 @@ void dlq_register_callsign (char addr[AX25_MAX_ADDR_LEN], int chan, int client)
773772

774773
pnew->type = DLQ_REGISTER_CALLSIGN;
775774
pnew->chan = chan;
776-
strlcpy (pnew->addrs[0], addr, AX25_MAX_ADDR_LEN);
775+
strlcpy (pnew->addrs[0], addr, sizeof(pnew->addrs[0]));
777776
pnew->num_addr = 1;
778777
pnew->client = client;
779778

@@ -784,7 +783,7 @@ void dlq_register_callsign (char addr[AX25_MAX_ADDR_LEN], int chan, int client)
784783
} /* end dlq_register_callsign */
785784

786785

787-
void dlq_unregister_callsign (char addr[AX25_MAX_ADDR_LEN], int chan, int client)
786+
void dlq_unregister_callsign (char *addr, int chan, int client)
788787
{
789788
struct dlq_item_s *pnew;
790789

@@ -808,7 +807,7 @@ void dlq_unregister_callsign (char addr[AX25_MAX_ADDR_LEN], int chan, int client
808807

809808
pnew->type = DLQ_UNREGISTER_CALLSIGN;
810809
pnew->chan = chan;
811-
strlcpy (pnew->addrs[0], addr, AX25_MAX_ADDR_LEN);
810+
strlcpy (pnew->addrs[0], addr, sizeof(pnew->addrs[0]));
812811
pnew->num_addr = 1;
813812
pnew->client = client;
814813

src/dlq.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ void dlq_outstanding_frames_request (char addrs[AX25_MAX_ADDRS][AX25_MAX_ADDR_LE
116116

117117
void dlq_xmit_data_request (char addrs[AX25_MAX_ADDRS][AX25_MAX_ADDR_LEN], int num_addr, int chan, int client, int pid, char *xdata_ptr, int xdata_len);
118118

119-
void dlq_register_callsign (char addr[AX25_MAX_ADDR_LEN], int chan, int client);
119+
void dlq_register_callsign (char *addr, int chan, int client);
120120

121-
void dlq_unregister_callsign (char addr[AX25_MAX_ADDR_LEN], int chan, int client);
121+
void dlq_unregister_callsign (char *addr, int chan, int client);
122122

123123
void dlq_channel_busy (int chan, int activity, int status);
124124

src/server.c

+10-8
Original file line numberDiff line numberDiff line change
@@ -1937,8 +1937,10 @@ static THREAD_F cmd_listen_thread (void *arg)
19371937
case 'D': /* Send Connected Data */
19381938

19391939
{
1940-
char callsigns[2][AX25_MAX_ADDR_LEN];
1941-
const int num_calls = 2;
1940+
char callsigns[AX25_MAX_ADDRS][AX25_MAX_ADDR_LEN];
1941+
memset (callsigns, 0, sizeof(callsigns));
1942+
const int num_calls = 2; // only first 2 used. Digipeater path
1943+
// must be remembered from connect request.
19421944

19431945
strlcpy (callsigns[AX25_SOURCE], cmd.hdr.call_from, sizeof(callsigns[AX25_SOURCE]));
19441946
strlcpy (callsigns[AX25_DESTINATION], cmd.hdr.call_to, sizeof(callsigns[AX25_SOURCE]));
@@ -1951,8 +1953,9 @@ static THREAD_F cmd_listen_thread (void *arg)
19511953
case 'd': /* Disconnect, Terminate an AX.25 Connection */
19521954

19531955
{
1954-
char callsigns[2][AX25_MAX_ADDR_LEN];
1955-
const int num_calls = 2;
1956+
char callsigns[AX25_MAX_ADDRS][AX25_MAX_ADDR_LEN];
1957+
memset (callsigns, 0, sizeof(callsigns));
1958+
const int num_calls = 2; // only first 2 used.
19561959

19571960
strlcpy (callsigns[AX25_SOURCE], cmd.hdr.call_from, sizeof(callsigns[AX25_SOURCE]));
19581961
strlcpy (callsigns[AX25_DESTINATION], cmd.hdr.call_to, sizeof(callsigns[AX25_SOURCE]));
@@ -2102,15 +2105,14 @@ static THREAD_F cmd_listen_thread (void *arg)
21022105

21032106
{
21042107

2105-
char callsigns[2][AX25_MAX_ADDR_LEN];
2106-
const int num_calls = 2;
2108+
char callsigns[AX25_MAX_ADDRS][AX25_MAX_ADDR_LEN];
2109+
memset (callsigns, 0, sizeof(callsigns));
2110+
const int num_calls = 2; // only first 2 used.
21072111

21082112
strlcpy (callsigns[AX25_SOURCE], cmd.hdr.call_from, sizeof(callsigns[AX25_SOURCE]));
21092113
strlcpy (callsigns[AX25_DESTINATION], cmd.hdr.call_to, sizeof(callsigns[AX25_SOURCE]));
21102114

2111-
// Issue 169. Proper implementation for 'Y'.
21122115
dlq_outstanding_frames_request (callsigns, num_calls, cmd.hdr.portx, client);
2113-
21142116
}
21152117
break;
21162118

0 commit comments

Comments
 (0)