Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: apps/gui/skin_engine/skin_tokens.c
- ===================================================================
- --- apps/gui/skin_engine/skin_tokens.c (Revision 25983)
- +++ apps/gui/skin_engine/skin_tokens.c (Arbeitskopie)
- @@ -398,13 +398,15 @@
- case WPS_TOKEN_PRESET_NAME:
- case WPS_TOKEN_PRESET_FREQ:
- {
- - int preset = radio_current_preset() + preset_offset;
- - if (radio_preset_count() == 0 || preset == -1)
- + int preset_count = radio_preset_count();
- + int cur_preset = radio_current_preset();
- + if (preset_count == 0 || cur_preset < 0)
- return NULL;
- - /* make sure its in the valid range */
- + int preset = cur_preset + preset_offset;
- + /* make sure it's in the valid range */
- while (preset < 0)
- - preset += radio_preset_count();
- - preset %= radio_preset_count();
- + preset += preset_count;
- + preset %= preset_count;
- if (token->type == WPS_TOKEN_PRESET_NAME)
- {
- snprintf(buf, buf_size, "%s", radio_get_preset(preset)->name);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement