From 77a3b50eb88ecfa53b8b6a803533a530d0c619ca Mon Sep 17 00:00:00 2001 From: WB2OSZ Date: Fri, 25 Mar 2016 21:39:32 -0400 Subject: [PATCH] Remove assert for invalid transmit channel and issue proper message. --- tq.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tq.c b/tq.c index 0a60f9d..88ad59e 100644 --- a/tq.c +++ b/tq.c @@ -214,7 +214,7 @@ void tq_append (int chan, int prio, packet_t pp) { packet_t plast; packet_t pnext; - //int a = ACHAN2ADEV(chan); /* Audio device for channel. */ + #if DEBUG text_color_set(DW_COLOR_DEBUG); @@ -222,8 +222,6 @@ void tq_append (int chan, int prio, packet_t pp) #endif - - assert (chan >= 0 && chan < MAX_CHANS); assert (prio >= 0 && prio < TQ_NUM_PRIO); if (pp == NULL) { @@ -240,7 +238,7 @@ void tq_append (int chan, int prio, packet_t pp) } #endif - if ( ! save_audio_config_p->achan[chan].valid) { + if (chan < 0 || chan >= MAX_CHANS || ! save_audio_config_p->achan[chan].valid) { text_color_set(DW_COLOR_ERROR); dw_printf ("ERROR - Request to transmit on invalid radio channel %d.\n", chan); ax25_delete(pp);