aboutsummaryrefslogtreecommitdiff
path: root/lib/parser.c
diff options
context:
space:
mode:
authorAndre Przywara <[email protected]>2022-02-11 12:26:28 +0000
committerAlexandre Belloni <[email protected]>2022-03-23 19:58:37 +0100
commit9f6cd82eca7e91a0d0311242a87c6aa3c2737968 (patch)
treea0fd28300cf6ca76a16745d1796cc494145b7b26 /lib/parser.c
parentea6af39f3da50c86367a71eb3cc674ade3ed244c (diff)
rtc: sun6i: Fix time overflow handling
Using "unsigned long" for UNIX timestamps is never a good idea, and comparing the value of such a variable against U32_MAX does not do anything useful on 32-bit systems. Use the proper time64_t type when dealing with timestamps, and avoid cutting down the time range unnecessarily. This also fixes the flawed check for the alarm time being too far into the future. The check for this condition is actually somewhat theoretical, as the RTC counts till 2033 only anyways, and 2^32 seconds from now is not before the year 2157 - at which point I hope nobody will be using this hardware anymore. Signed-off-by: Andre Przywara <[email protected]> Reviewed-by: Jernej Skrabec <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]> Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'lib/parser.c')
0 files changed, 0 insertions, 0 deletions