summaryrefslogtreecommitdiff
path: root/apps/menus/time_menu.c
diff options
context:
space:
mode:
authorTeruaki Kawashima <teru@rockbox.org>2009-10-30 14:34:13 +0000
committerTeruaki Kawashima <teru@rockbox.org>2009-10-30 14:34:13 +0000
commita404e9ae24bb99e127e7f43a545e717c14e49ff5 (patch)
tree6cbf7aa4e78bd04d6d96f7ba780383f41f61f41e /apps/menus/time_menu.c
parent08c5a66f8ac08b5d2d25d8804e6c8603577664f7 (diff)
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
Diffstat (limited to 'apps/menus/time_menu.c')
-rw-r--r--apps/menus/time_menu.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/menus/time_menu.c b/apps/menus/time_menu.c
index cb31c33fc9..b1ea33f858 100644
--- a/apps/menus/time_menu.c
+++ b/apps/menus/time_menu.c
@@ -175,14 +175,14 @@ static void draw_timedate(struct viewport *vp, struct screen *display)
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 :
((tm->tm_hour + 11) % 12) + 1,
tm->tm_min,
tm->tm_sec,
global_settings.timeformat == 0 ? "" :
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),
tm->tm_mday,
tm->tm_year+1900);
@@ -193,8 +193,8 @@ static void draw_timedate(struct viewport *vp, struct screen *display)
d = str(LANG_UNKNOWN);
}
- display->puts_scroll(0, line++, time);
- display->puts_scroll(0, line, date);
+ display->puts_scroll(0, line++, t);
+ display->puts_scroll(0, line, d);
display->update_viewport();
display->set_viewport(NULL);