File: 1690555105.FILE5_45-1-g218fdf81.deal-with-32-bit-time-t.patch

package info (click to toggle)
file 1%3A5.45-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 6,356 kB
  • sloc: ansic: 17,739; sh: 4,291; makefile: 653; python: 267
file content (21 lines) | stat: -rw-r--r-- 811 bytes parent folder | download | duplicates (3)
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 */