diff options
author | Thomas Martitz <kugel@rockbox.org> | 2009-08-24 16:12:45 +0000 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2009-08-24 16:12:45 +0000 |
commit | 1747a33fcc9ceb8b78012d662086aeac51490812 (patch) | |
tree | 5e0fba76d959df68cb1ec73cd59dcdb24b0696d6 /apps | |
parent | af68987d5cbe538a738ce7be0c99d83792fc7269 (diff) | |
download | rockbox-1747a33fcc9ceb8b78012d662086aeac51490812.tar.gz rockbox-1747a33fcc9ceb8b78012d662086aeac51490812.zip |
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
Diffstat (limited to 'apps')
-rw-r--r-- | apps/settings.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/apps/settings.c b/apps/settings.c index 98cd6ebc95..4c16c6a0ec 100644 --- a/apps/settings.c +++ b/apps/settings.c | |||
@@ -308,7 +308,13 @@ bool settings_load_config(const char* file, bool apply) | |||
308 | *v = temp; | 308 | *v = temp; |
309 | } | 309 | } |
310 | else | 310 | else |
311 | *v = atoi(value); | 311 | { /* atoi breaks choice settings because they |
312 | * don't have int-like values, and would | ||
313 | * fall back to the first value (i.e. 0) | ||
314 | * due to atoi */ | ||
315 | if (!(settings[i].flags&F_CHOICE_SETTING)) | ||
316 | *v = atoi(value); | ||
317 | } | ||
312 | } | 318 | } |
313 | break; | 319 | break; |
314 | case F_T_BOOL: | 320 | case F_T_BOOL: |