From 6be16ab3c85dd89bc69277a4fe7cbd19042751a7 Mon Sep 17 00:00:00 2001 From: WB2OSZ Date: Sun, 5 Mar 2017 14:56:34 -0500 Subject: [PATCH] More error checking in config file. Complain if filter already specified for this from/to pair. --- config.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/config.c b/config.c index db9325f..16fe2b5 100644 --- a/config.c +++ b/config.c @@ -2341,9 +2341,17 @@ void config_init (char *fname, struct audio_s *p_audio_config, t = " "; /* Empty means permit nothing. */ } + if (p_digi_config->filter_str[from_chan][to_chan] != NULL) { + text_color_set(DW_COLOR_ERROR); + dw_printf ("Config file, line %d: Replacing previous filter for same from/to pair:\n %s\n", + line, p_digi_config->filter_str[from_chan][to_chan]); + free (p_digi_config->filter_str[from_chan][to_chan]); + p_digi_config->filter_str[from_chan][to_chan] = NULL; + } + p_digi_config->filter_str[from_chan][to_chan] = strdup(t); -//TODO1.2: Do a test run to see errors now instead of waiting. +//TODO: Do a test run to see errors now instead of waiting. }