aboutsummaryrefslogtreecommitdiff
path: root/contrib/libarchive/libarchive/archive_read_support_format_rar.c
diff options
context:
space:
mode:
authorMartin Matuska <mm@FreeBSD.org>2023-07-24 05:42:43 +0000
committerMartin Matuska <mm@FreeBSD.org>2024-05-04 11:53:07 +0000
commitcd09ca5e71a541c47752782d0b710bc95d97cbef (patch)
tree2ff5fbb504c7e48d1fc9553bfeb20f7cfcf614d2 /contrib/libarchive/libarchive/archive_read_support_format_rar.c
parentd2291dbb3ccbb772fdeb9fdae88602771564e607 (diff)
downloadsrc-cd09ca5e71a541c47752782d0b710bc95d97cbef.tar.gz
src-cd09ca5e71a541c47752782d0b710bc95d97cbef.zip
libarchive: merge from vendor branch
Libarchive 3.7.0 Important changes (relevant to FreeBSD): #1814 Do not account for NULL terminator when comparing with "TRAILER!!!" #1818 Add ability to produce multi-frame zstd archives #1840 year 2038 fix for pax archives on platforms with 64-bit time_t #1860 Make single bit bitfields unsigned to avoid clang 16 warning #1869 Fix FreeBSD builds with WARNS=6 #1873 bsdunzip ported to libarchive from FreeBSD #1894 read support for zstd compression in 7zip archives #1918 ARM64 filter support in 7zip archives (cherry picked from commit e64fe029e9d3ce476e77a478318e0c3cd201ff08)
Diffstat (limited to 'contrib/libarchive/libarchive/archive_read_support_format_rar.c')
-rw-r--r--contrib/libarchive/libarchive/archive_read_support_format_rar.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/contrib/libarchive/libarchive/archive_read_support_format_rar.c b/contrib/libarchive/libarchive/archive_read_support_format_rar.c
index 793e8e985214..8f239da9b39d 100644
--- a/contrib/libarchive/libarchive/archive_read_support_format_rar.c
+++ b/contrib/libarchive/libarchive/archive_read_support_format_rar.c
@@ -1830,13 +1830,9 @@ read_exttime(const char *p, struct rar *rar, const char *endp)
struct tm *tm;
time_t t;
long nsec;
-#if defined(HAVE_LOCALTIME_R) || defined(HAVE__LOCALTIME64_S)
+#if defined(HAVE_LOCALTIME_R) || defined(HAVE_LOCALTIME_S)
struct tm tmbuf;
#endif
-#if defined(HAVE__LOCALTIME64_S)
- errno_t terr;
- __time64_t tmptime;
-#endif
if (p + 2 > endp)
return (-1);
@@ -1868,15 +1864,10 @@ read_exttime(const char *p, struct rar *rar, const char *endp)
rem = (((unsigned)(unsigned char)*p) << 16) | (rem >> 8);
p++;
}
-#if defined(HAVE_LOCALTIME_R)
+#if defined(HAVE_LOCALTIME_S)
+ tm = localtime_s(&tmbuf, &t) ? NULL : &tmbuf;
+#elif defined(HAVE_LOCALTIME_R)
tm = localtime_r(&t, &tmbuf);
-#elif defined(HAVE__LOCALTIME64_S)
- tmptime = t;
- terr = _localtime64_s(&tmbuf, &tmptime);
- if (terr)
- tm = NULL;
- else
- tm = &tmbuf;
#else
tm = localtime(&t);
#endif