summaryrefslogtreecommitdiff
path: root/sfeed.c
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2023-03-26 15:26:08 +0200
committerHiltjo Posthuma <hiltjo@codemadness.org>2023-03-26 15:26:08 +0200
commitd2f63645bf165726384f50f4e8b0f3ee048e7ae3 (patch)
treedbad76b82466d5a9930df67321dda8bd09cce210 /sfeed.c
parentdaf56f2cb0a6994c4be8f1b57f1eb4b4cb8c91ba (diff)
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 (limited to 'sfeed.c')
-rw-r--r--sfeed.c2
1 files changed, 1 insertions, 1 deletions
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 };