summaryrefslogtreecommitdiffstats
path: root/debian/patches/1690555105.FILE5_45-1-g218fdf81.deal-with-32-bit-time-t.patch
blob: 178ec545af91ba77473943f4c853ebee9ffa72e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Subject: Deal with 32 bit time_t
Origin: FILE5_45-1-g218fdf81 <https://github.com/file/file/commit/FILE5_45-1-g218fdf81>
Upstream-Author: Christos Zoulas <christos@zoulas.com>
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 */