Remove assert for invalid transmit channel and issue proper message.

This commit is contained in:
WB2OSZ 2016-03-25 21:39:32 -04:00
parent ce9eebf273
commit 77a3b50eb8
1 changed files with 2 additions and 4 deletions

6
tq.c
View File

@ -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);