summaryrefslogtreecommitdiff
path: root/Cryptlib/SysCall/TimerWrapper.c
diff options
context:
space:
mode:
authorGary Ching-Pang Lin <glin@suse.com>2013-07-09 17:30:02 +0800
committerPeter Jones <pjones@redhat.com>2013-09-26 11:58:02 -0400
commitf6d1f6aa3238d9ec8798458bdd6f87691e81a11b (patch)
treea028d50d41b08174cd619c77a99650ad213fc103 /Cryptlib/SysCall/TimerWrapper.c
parent681082e6c4722bfbc4d8b4b651d62bf139c3df6b (diff)
downloadefi-boot-shim-f6d1f6aa3238d9ec8798458bdd6f87691e81a11b.tar.gz
efi-boot-shim-f6d1f6aa3238d9ec8798458bdd6f87691e81a11b.zip
Adjust the result of gmtime() to fit the definition
Diffstat (limited to 'Cryptlib/SysCall/TimerWrapper.c')
-rw-r--r--Cryptlib/SysCall/TimerWrapper.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Cryptlib/SysCall/TimerWrapper.c b/Cryptlib/SysCall/TimerWrapper.c
index bb7bcba7..cee72ba5 100644
--- a/Cryptlib/SysCall/TimerWrapper.c
+++ b/Cryptlib/SysCall/TimerWrapper.c
@@ -146,14 +146,14 @@ struct tm * gmtime (const time_t *timer)
GmTime->tm_yday = (int) DayNo;
for (MonthNo = 12; MonthNo > 1; MonthNo--) {
- if (DayNo > CumulativeDays[IsLeap(Year)][MonthNo]) {
+ if (DayNo >= CumulativeDays[IsLeap(Year)][MonthNo]) {
DayNo = (UINT16) (DayNo - (UINT16) (CumulativeDays[IsLeap(Year)][MonthNo]));
break;
}
}
- GmTime->tm_mon = (int) MonthNo;
- GmTime->tm_mday = (int) DayNo;
+ GmTime->tm_mon = (int) MonthNo - 1;
+ GmTime->tm_mday = (int) DayNo + 1;
GmTime->tm_isdst = 0;
GmTime->tm_gmtoff = 0;