This commit is contained in:
Jeff Deaton 2018-07-05 03:43:21 +00:00 committed by GitHub
commit e1b15a8d38
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 3 deletions

View File

@ -993,9 +993,19 @@ 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])) { char adevicestr[2];
adevice = t[7] - '0'; int t_len;
}
adevicestr[0] = adevicestr[1] = 0;
t_len = strnlen(t,9);
if (t_len == 8)
adevicestr[0] = t[7];
else if (t_len == 9) {
adevicestr[0] = t[7];
adevicestr[1] = t[8];
}
adevice = atoi(adevicestr);
if (adevice < 0 || adevice >= MAX_ADEVS) { if (adevice < 0 || adevice >= MAX_ADEVS) {
text_color_set(DW_COLOR_ERROR); text_color_set(DW_COLOR_ERROR);