More error checking in config file.

Complain if filter already specified for this from/to pair.
This commit is contained in:
WB2OSZ 2017-03-05 14:56:34 -05:00
parent 67b11d4922
commit 6be16ab3c8
1 changed files with 9 additions and 1 deletions

View File

@ -2341,9 +2341,17 @@ void config_init (char *fname, struct audio_s *p_audio_config,
t = " "; /* Empty means permit nothing. */ 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); 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.
} }