fix the %Ti (preset index) not working with conditionls correctly

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26246 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jonathan Gordon 2010-05-24 09:18:03 +00:00
parent ba46c88c6f
commit dda102ed4a

View file

@ -417,11 +417,9 @@ const char *get_radio_token(struct wps_token *token, int preset_offset,
case WPS_TOKEN_TUNER_CURFREQ:
return format_freq_MHz(radio_current_frequency(),
region_data->freq_step, buf, buf_size);
case WPS_TOKEN_PRESET_ID:
snprintf(buf, buf_size, "%d", radio_current_preset() + 1 + preset_offset);
return buf;
case WPS_TOKEN_PRESET_NAME:
case WPS_TOKEN_PRESET_FREQ:
case WPS_TOKEN_PRESET_ID:
{
int preset_count = radio_preset_count();
int cur_preset = radio_current_preset();
@ -434,9 +432,11 @@ const char *get_radio_token(struct wps_token *token, int preset_offset,
preset += preset_count;
if (token->type == WPS_TOKEN_PRESET_NAME)
snprintf(buf, buf_size, "%s", radio_get_preset(preset)->name);
else
else if (token->type == WPS_TOKEN_PRESET_FREQ)
format_freq_MHz(radio_get_preset(preset)->frequency,
region_data->freq_step, buf, buf_size);
else
snprintf(buf, buf_size, "%d", preset + 1);
return buf;
}
case WPS_TOKEN_PRESET_COUNT: