From 5736b0f601e55b2fdafe32858679b68db00f5995 Mon Sep 17 00:00:00 2001 From: wb2osz Date: Tue, 29 Oct 2024 19:41:35 +0100 Subject: [PATCH] Check index. --- src/igate.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/igate.c b/src/igate.c index 1e5d56e..b11f7a3 100644 --- a/src/igate.c +++ b/src/igate.c @@ -1071,6 +1071,8 @@ void igate_send_rec_packet (int chan, packet_t recv_pp) * Inputs: pp - Packet object. * * chan - Radio channel where it was received. + * This will be -1 if from a beacon with sendto=ig + * so be careful if using as subscript. * * Description: Duplicate detection is handled here. * Suppress if same was sent recently. @@ -1141,7 +1143,7 @@ static void send_packet_to_server (packet_t pp, int chan) strlcat (msg, ",qAO,", sizeof(msg)); // new for version 1.4. } - strlcat (msg, save_audio_config_p->mycall[chan], sizeof(msg)); + strlcat (msg, save_audio_config_p->mycall[chan>=0 ? chan : 0], sizeof(msg)); strlcat (msg, ":", sizeof(msg));