sfeed.c: datetounix: fix incorrect int type to long - sfeed - RSS and Atom parser (HTM) git clone git://git.codemadness.org/sfeed (DIR) Log (DIR) Files (DIR) Refs (DIR) README (DIR) LICENSE --- (DIR) commit d2f63645bf165726384f50f4e8b0f3ee048e7ae3 (DIR) parent daf56f2cb0a6994c4be8f1b57f1eb4b4cb8c91ba (HTM) Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Sun, 26 Mar 2023 15:26:08 +0200 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. Diffstat: M sfeed.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- (DIR) diff --git 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 };