SECSPERDAY is 86400 which exceeds the limit of a UINT16 which is 65536.
Therefore DayRemainder cannot use UINT16. This patch makes it UINT32.
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Julien Grall <julien@xen.org>
Signed-off-by: Yuan Yu <yuanyu@google.com>
Reviewed-by: Ard Biesheuvel <ardb+tianocore@kernel.org>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
{\r
struct tm *GmTime;\r
UINT16 DayNo;\r
- UINT16 DayRemainder;\r
+ UINT32 DayRemainder;\r
time_t Year;\r
time_t YearNo;\r
UINT16 TotalDays;\r
ZeroMem ((VOID *)GmTime, (UINTN)sizeof (struct tm));\r
\r
DayNo = (UINT16)(*timer / SECSPERDAY);\r
- DayRemainder = (UINT16)(*timer % SECSPERDAY);\r
+ DayRemainder = (UINT32)(*timer % SECSPERDAY);\r
\r
GmTime->tm_sec = (int)(DayRemainder % SECSPERMIN);\r
GmTime->tm_min = (int)((DayRemainder % SECSPERHOUR) / SECSPERMIN);\r