Advertisement
Guest User

Untitled

a guest
May 13th, 2010
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. Index: apps/gui/skin_engine/skin_tokens.c
  2. ===================================================================
  3. --- apps/gui/skin_engine/skin_tokens.c (Revision 25983)
  4. +++ apps/gui/skin_engine/skin_tokens.c (Arbeitskopie)
  5. @@ -398,13 +398,15 @@
  6. case WPS_TOKEN_PRESET_NAME:
  7. case WPS_TOKEN_PRESET_FREQ:
  8. {
  9. - int preset = radio_current_preset() + preset_offset;
  10. - if (radio_preset_count() == 0 || preset == -1)
  11. + int preset_count = radio_preset_count();
  12. + int cur_preset = radio_current_preset();
  13. + if (preset_count == 0 || cur_preset < 0)
  14. return NULL;
  15. - /* make sure its in the valid range */
  16. + int preset = cur_preset + preset_offset;
  17. + /* make sure it's in the valid range */
  18. while (preset < 0)
  19. - preset += radio_preset_count();
  20. - preset %= radio_preset_count();
  21. + preset += preset_count;
  22. + preset %= preset_count;
  23. if (token->type == WPS_TOKEN_PRESET_NAME)
  24. {
  25. snprintf(buf, buf_size, "%s", radio_get_preset(preset)->name);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement