Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Updated so that ADEVICE[n] lines within the configuration file can ha…
…ve up to 100 potential entries (instead of just 10).
  • Loading branch information
Deatojef committed Jul 5, 2018
commit 567a1036cabc01f61d58775e8e7aefaaf200cb3f
16 changes: 13 additions & 3 deletions config.c
Original file line number Diff line number Diff line change
Expand Up @@ -993,9 +993,19 @@ void config_init (char *fname, struct audio_s *p_audio_config,

if (strncasecmp(t, "ADEVICE", 7) == 0) {
adevice = 0;
if (isdigit(t[7])) {
adevice = t[7] - '0';
}
char adevicestr[2];
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) {
text_color_set(DW_COLOR_ERROR);
Expand Down