From 52b529e893ec484314e2bdff1190bbcb39007b8a Mon Sep 17 00:00:00 2001 From: teru Date: Fri, 30 Oct 2009 14:34:13 +0000 Subject: [PATCH] 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(-) diff --git a/apps/menus/time_menu.c b/apps/menus/time_menu.c index cb31c33fc..b1ea33f85 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); -- 2.11.4.GIT