1690555105.FILE5_45-1-g218fdf81.deal-with-32-bit-time-t.patch 811 B

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