Revision: 14481
http://sourceforge.net/p/edk2/code/14481
Author: tye1
Date: 2013-07-17 07:53:04 +0000 (Wed, 17 Jul 2013)
Log Message:
-----------
Per gmtime manpage, tm_mon is the number of months since January
while MonthNo is the month of the year, so tm_mon should be MonthNo-1.
Similarly, tm_mday is the day of the month, and DayNo is the number
of days since the first day of the month. Assigning DayNo+1 to
tm_mday to fit the definition.
This commit also corrected miscalculated MonthNo and DayNo for the
first day of the month. (Thanks to Laszlo Ersek!)
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Ching-Pang Lin <[email protected]>
Reviewed-by: Laszlo Ersek <[email protected]>
Reviewed-by: Long Qin <[email protected]>
Reviewed-by: Ye Ting <[email protected]>
Modified Paths:
--------------
trunk/edk2/CryptoPkg/Library/BaseCryptLib/SysCall/TimerWrapper.c
Modified: trunk/edk2/CryptoPkg/Library/BaseCryptLib/SysCall/TimerWrapper.c
===================================================================
--- trunk/edk2/CryptoPkg/Library/BaseCryptLib/SysCall/TimerWrapper.c
2013-07-17 06:26:10 UTC (rev 14480)
+++ trunk/edk2/CryptoPkg/Library/BaseCryptLib/SysCall/TimerWrapper.c
2013-07-17 07:53:04 UTC (rev 14481)
@@ -148,14 +148,14 @@
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;
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits