From c7739b9c04b4b49888e1161164b1cdac0d9930ca Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Sun, 26 Mar 2023 18:03:24 +0200 Subject: sfeed.c: datetounix: simplify calculation and make it slightly easier to read This also fixes a calculation (possibly a compiler bug) with Open Watcom 1.9. --- sfeed.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sfeed.c b/sfeed.c index 2956505..4337300 100644 --- a/sfeed.c +++ b/sfeed.c @@ -475,7 +475,7 @@ datetounix(long long year, int mon, int day, int hour, int min, int sec) } } leaps += 97 * cycles + 24 * centuries - is_leap; - t = (year - 100) * 31536000LL + leaps * 86400LL + 946684800 + 86400; + t = ((year - 100) * 31536000LL) + (leaps * 86400LL) + 946771200LL; } t += secs_through_month[mon]; if (is_leap && mon >= 2) -- cgit v1.2.3