Subject: Deal with 32 bit time_t Origin: FILE5_45-1-g218fdf81 Upstream-Author: Christos Zoulas Date: Fri Jul 28 14:38:25 2023 +0000 --- a/src/file.h +++ b/src/file.h @@ -159,9 +159,11 @@ /* * Dec 31, 23:59:59 9999 * we need to make sure that we don't exceed 9999 because some libc - * implementations like muslc crash otherwise + * implementations like muslc crash otherwise. If you are unlucky + * to be running on a system with a 32 bit time_t, then it is even less. */ -#define MAX_CTIME CAST(time_t, 0x3afff487cfULL) +#define MAX_CTIME \ + CAST(time_t, sizeof(time_t) > 4 ? 0x3afff487cfULL : 0x7fffffffULL) #define FILE_BADSIZE CAST(size_t, ~0ul) #define MAXDESC 64 /* max len of text description/MIME type */