Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 567a103

Browse files
committedJul 5, 2018
Updated so that ADEVICE[n] lines within the configuration file can have up to 100 potential entries (instead of just 10).
1 parent 4ecaf47 commit 567a103

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed
 

‎config.c

+13-3
Original file line numberDiff line numberDiff line change
@@ -993,9 +993,19 @@ void config_init (char *fname, struct audio_s *p_audio_config,
993993

994994
if (strncasecmp(t, "ADEVICE", 7) == 0) {
995995
adevice = 0;
996-
if (isdigit(t[7])) {
997-
adevice = t[7] - '0';
998-
}
996+
char adevicestr[2];
997+
int t_len;
998+
999+
adevicestr[0] = adevicestr[1] = 0;
1000+
1001+
t_len = strnlen(t,9);
1002+
if (t_len == 8)
1003+
adevicestr[0] = t[7];
1004+
else if (t_len == 9) {
1005+
adevicestr[0] = t[7];
1006+
adevicestr[1] = t[8];
1007+
}
1008+
adevice = atoi(adevicestr);
9991009

10001010
if (adevice < 0 || adevice >= MAX_ADEVS) {
10011011
text_color_set(DW_COLOR_ERROR);

0 commit comments

Comments
 (0)
Please sign in to comment.