1
0
Fork 0
forked from len0rd/rockbox

Fix time display in time menu when time is not valid.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23421 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Teruaki Kawashima 2009-10-30 14:34:13 +00:00
parent 08c5a66f8a
commit a404e9ae24

View file

@ -175,14 +175,14 @@ static void draw_timedate(struct viewport *vp, struct screen *display)
if (valid_time(tm)) if (valid_time(tm))
{ {
snprintf(time, 16, "%02d:%02d:%02d%s", snprintf(time, sizeof(time), "%02d:%02d:%02d%s",
global_settings.timeformat == 0 ? tm->tm_hour : global_settings.timeformat == 0 ? tm->tm_hour :
((tm->tm_hour + 11) % 12) + 1, ((tm->tm_hour + 11) % 12) + 1,
tm->tm_min, tm->tm_min,
tm->tm_sec, tm->tm_sec,
global_settings.timeformat == 0 ? "" : global_settings.timeformat == 0 ? "" :
tm->tm_hour>11 ? " P" : " A"); tm->tm_hour>11 ? " P" : " A");
snprintf(date, 16, "%s %d %d", snprintf(date, sizeof(date), "%s %d %d",
str(LANG_MONTH_JANUARY + tm->tm_mon), str(LANG_MONTH_JANUARY + tm->tm_mon),
tm->tm_mday, tm->tm_mday,
tm->tm_year+1900); tm->tm_year+1900);
@ -193,8 +193,8 @@ static void draw_timedate(struct viewport *vp, struct screen *display)
d = str(LANG_UNKNOWN); d = str(LANG_UNKNOWN);
} }
display->puts_scroll(0, line++, time); display->puts_scroll(0, line++, t);
display->puts_scroll(0, line, date); display->puts_scroll(0, line, d);
display->update_viewport(); display->update_viewport();
display->set_viewport(NULL); display->set_viewport(NULL);