Skip to content

Commit 6be16ab

Browse files
committed
More error checking in config file.
Complain if filter already specified for this from/to pair.
1 parent 67b11d4 commit 6be16ab

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

config.c

+9-1
Original file line numberDiff line numberDiff line change
@@ -2341,9 +2341,17 @@ void config_init (char *fname, struct audio_s *p_audio_config,
23412341
t = " "; /* Empty means permit nothing. */
23422342
}
23432343

2344+
if (p_digi_config->filter_str[from_chan][to_chan] != NULL) {
2345+
text_color_set(DW_COLOR_ERROR);
2346+
dw_printf ("Config file, line %d: Replacing previous filter for same from/to pair:\n %s\n",
2347+
line, p_digi_config->filter_str[from_chan][to_chan]);
2348+
free (p_digi_config->filter_str[from_chan][to_chan]);
2349+
p_digi_config->filter_str[from_chan][to_chan] = NULL;
2350+
}
2351+
23442352
p_digi_config->filter_str[from_chan][to_chan] = strdup(t);
23452353

2346-
//TODO1.2: Do a test run to see errors now instead of waiting.
2354+
//TODO: Do a test run to see errors now instead of waiting.
23472355

23482356
}
23492357

0 commit comments

Comments
 (0)