Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static const uint8_t g_acDaysInMonths[12] =
- {
- /*Jan Feb Mar Arp May Jun Jul Aug Sep Oct Nov Dec */
- 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
- };
- static const uint8_t g_acDaysInMonthsLeap[12] =
- {
- /*Jan Feb Mar Arp May Jun Jul Aug Sep Oct Nov Dec */
- 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
- };
- static PRTTIME rtTimeNormalizeInternal(PRTTIME pTime)
- {
- ....
- unsigned cDaysInMonth = fLeapYear
- ? g_acDaysInMonthsLeap[pTime->u8Month - 1] //<==
- : g_acDaysInMonthsLeap[pTime->u8Month - 1]; //<==
- ....
- }
- This suspicious code was found in VirtualBox project by PVS-Studio static code analyzer.
- Warning message is:
- V583 The '?:' operator, regardless of its conditional expression, always returns one and the same value: g_acDaysInMonthsLeap[pTime->u8Month - 1]. time.cpp 453
- PVS-Studio is a static analyzer for detecting bugs in the source code of applications written in C, C++, C++11, C++/CX. Site: http://www.viva64.com/en/pvs-studio/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement