From a404e9ae24bb99e127e7f43a545e717c14e49ff5 Mon Sep 17 00:00:00 2001 From: Teruaki Kawashima Date: Fri, 30 Oct 2009 14:34:13 +0000 Subject: 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 --- apps/menus/time_menu.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'apps') 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); -- cgit v1.2.3