From ae16c4034c37a28e352936d0600b51be21340524 Mon Sep 17 00:00:00 2001 From: Yasha Cherikovsky Date: Sat, 14 Nov 2015 19:16:58 +0200 Subject: coreinfo: Fix off-by-one in displayed month of year According to C documentation, the range of tm_mon in struct tm is [0, 11]. Before the patch, the displayed month was indeed incorrect. Change-Id: I9f95f1e978c45b3635e2edfe1ec496d7b0dec00a Signed-off-by: Yasha Cherikovsky Reviewed-on: http://review.coreboot.org/12438 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth --- payloads/coreinfo/coreinfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'payloads/coreinfo') diff --git a/payloads/coreinfo/coreinfo.c b/payloads/coreinfo/coreinfo.c index 5137ce6192..a3833307db 100644 --- a/payloads/coreinfo/coreinfo.c +++ b/payloads/coreinfo/coreinfo.c @@ -128,7 +128,7 @@ static void print_time_and_date(void) rtc_read_clock(&tm); mvwprintw(menuwin, 0, 57, "%02d/%02d/%04d - %02d:%02d:%02d", - tm.tm_mon, tm.tm_mday, 1900 + tm.tm_year, tm.tm_hour, + tm.tm_mon + 1, tm.tm_mday, 1900 + tm.tm_year, tm.tm_hour, tm.tm_min, tm.tm_sec); } #endif -- cgit v1.2.3