From 75ccf181f95e6e7f1014d4d5599de626d6f66023 Mon Sep 17 00:00:00 2001 From: wb2osz Date: Fri, 7 Apr 2023 16:29:27 -0400 Subject: [PATCH] Improve config error checking. --- src/config.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/config.c b/src/config.c index a71d9e2..fdaa143 100644 --- a/src/config.c +++ b/src/config.c @@ -4600,6 +4600,13 @@ void config_init (char *fname, struct audio_s *p_audio_config, continue; } n = atoi(t); + t = split(NULL,0); + if (t != NULL) { + text_color_set(DW_COLOR_ERROR); + dw_printf ("Line %d: Unexpected \"%s\" after the port number.\n", line, t); + dw_printf ("Perhaps you were trying to use feature available only with KISSPORT.\n"); + continue; + } if ((n >= MIN_IP_PORT_NUMBER && n <= MAX_IP_PORT_NUMBER) || n == 0) { p_misc_config->agwpe_port = n; } @@ -4609,13 +4616,6 @@ void config_init (char *fname, struct audio_s *p_audio_config, dw_printf ("Line %d: Invalid port number for AGW TCPIP Socket Interface. Using %d.\n", line, p_misc_config->agwpe_port); } - t = split(NULL,0); - if (t != NULL) { - text_color_set(DW_COLOR_ERROR); - dw_printf ("Line %d: Unexpected \"%s\" is ignored.\n", line, t); - dw_printf ("Perhaps you were trying to use feature available only with KISSPORT.\n"); - continue; - } } /*