diff options
Diffstat (limited to 'debian/patches/1690555105.FILE5_45-1-g218fdf81.deal-with-32-bit-time-t.patch')
-rw-r--r-- | debian/patches/1690555105.FILE5_45-1-g218fdf81.deal-with-32-bit-time-t.patch | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/debian/patches/1690555105.FILE5_45-1-g218fdf81.deal-with-32-bit-time-t.patch b/debian/patches/1690555105.FILE5_45-1-g218fdf81.deal-with-32-bit-time-t.patch new file mode 100644 index 0000000..178ec54 --- /dev/null +++ b/debian/patches/1690555105.FILE5_45-1-g218fdf81.deal-with-32-bit-time-t.patch @@ -0,0 +1,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 */ |