mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 18:17:39 -04:00
Fix a problem spotted in FS#10543. For F_CHOICE_SETTING, an invalid value would (which may happen if the values changed e.g. due to the statusbar at bottom addition) lead to the correspong 0 value, instead of leaving the setting untouched. Fix it by not calling atoi() for F_CHOICE_SETTING (they don't have int-like values).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22499 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
af68987d5c
commit
1747a33fcc
1 changed files with 7 additions and 1 deletions
|
@ -308,7 +308,13 @@ bool settings_load_config(const char* file, bool apply)
|
|||
*v = temp;
|
||||
}
|
||||
else
|
||||
*v = atoi(value);
|
||||
{ /* atoi breaks choice settings because they
|
||||
* don't have int-like values, and would
|
||||
* fall back to the first value (i.e. 0)
|
||||
* due to atoi */
|
||||
if (!(settings[i].flags&F_CHOICE_SETTING))
|
||||
*v = atoi(value);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case F_T_BOOL:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue