From d2f63645bf165726384f50f4e8b0f3ee048e7ae3 Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Sun, 26 Mar 2023 15:26:08 +0200 Subject: sfeed.c: datetounix: fix incorrect int type to long Found while testing sfeed on MS-DOS with Open Watcom (for fun :)). There an int is 16-bit and sfeed incorrectly wrapped the value, which produced incorrect parsed UNIX timestamps as output. --- sfeed.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sfeed.c b/sfeed.c index 8a2843e..2956505 100644 --- a/sfeed.c +++ b/sfeed.c @@ -436,7 +436,7 @@ string_print_timestamp(String *s) static long long datetounix(long long year, int mon, int day, int hour, int min, int sec) { - static const int secs_through_month[] = { + static const long secs_through_month[] = { 0, 31 * 86400, 59 * 86400, 90 * 86400, 120 * 86400, 151 * 86400, 181 * 86400, 212 * 86400, 243 * 86400, 273 * 86400, 304 * 86400, 334 * 86400 }; -- cgit v1.2.3