Allow much greater numbers of ADEVICE's within the configuration file

This commit is contained in:
Jeff Deaton 2018-07-05 22:47:35 -06:00
parent 4ecaf478cf
commit bc4a63e7ab
1 changed files with 2 additions and 3 deletions

View File

@ -993,9 +993,8 @@ void config_init (char *fname, struct audio_s *p_audio_config,
if (strncasecmp(t, "ADEVICE", 7) == 0) { if (strncasecmp(t, "ADEVICE", 7) == 0) {
adevice = 0; adevice = 0;
if (isdigit(t[7])) { if (strnlen(t, 9) >= 8)
adevice = t[7] - '0'; adevice = atoi(t+7);
}
if (adevice < 0 || adevice >= MAX_ADEVS) { if (adevice < 0 || adevice >= MAX_ADEVS) {
text_color_set(DW_COLOR_ERROR); text_color_set(DW_COLOR_ERROR);