diff options
author | Jens Arnold <amiconn@rockbox.org> | 2007-03-31 12:37:03 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2007-03-31 12:37:03 +0000 |
commit | 81625742c934c895958b91ee197b505a05c4c53c (patch) | |
tree | 29fc92afd7486a92138f40407dab92a0f44091af /apps | |
parent | 54ea2e435e1a5688de4e4dcf551a1fc9c1db323f (diff) | |
download | rockbox-81625742c934c895958b91ee197b505a05c4c53c.tar.gz rockbox-81625742c934c895958b91ee197b505a05c4c53c.zip |
Player: Fix setting integer values to their min/max values.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12980 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r-- | apps/settings.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/settings.c b/apps/settings.c index 57db619d72..0206b97d14 100644 --- a/apps/settings.c +++ b/apps/settings.c @@ -1218,6 +1218,7 @@ bool set_int_ex(const unsigned char* string, void (*formatter)(char*, int, int, const char*), long (*get_talk_id)(int)) { + int count = (max-min)/step + 1; #if CONFIG_KEYPAD != PLAYER_PAD struct value_setting_data data = { INT,max, step, voice_unit,unit,formatter,get_talk_id,NULL }; @@ -1225,10 +1226,9 @@ bool set_int_ex(const unsigned char* string, data.unit = unit_strings[voice_unit]; else data.unit = str(voice_unit); - return do_set_setting(string,variable,(max-min)/step + 1, + return do_set_setting(string,variable,count, (max-*variable)/step, &data,function); #else - int count = (max-min)/step + 1; struct value_setting_data data = { INT,min, -step, voice_unit,unit,formatter,get_talk_id,NULL }; if (voice_unit < UNIT_LAST) @@ -1236,7 +1236,7 @@ bool set_int_ex(const unsigned char* string, else data.unit = str(voice_unit); return do_set_setting(string,variable,count, - count - ((max-*variable)/step), &data,function); + (*variable-min)/step, &data,function); #endif } bool set_int(const unsigned char* string, |