diff options
author | Martin Matuska <mm@FreeBSD.org> | 2023-07-24 05:42:43 +0000 |
---|---|---|
committer | Martin Matuska <mm@FreeBSD.org> | 2023-07-24 05:42:43 +0000 |
commit | e64fe029e9d3ce476e77a478318e0c3cd201ff08 (patch) | |
tree | dc8512751bd45120580402b09ff3df7df4c05673 /contrib/libarchive/libarchive/archive_read_support_format_rar.c | |
parent | 7f9318a022ef0e5104fd429dc2d9ac37b9916353 (diff) | |
parent | 14b646f7c3f709cd0de2d59db3691273bc8d6d16 (diff) | |
download | src-e64fe029e9d3ce476e77a478318e0c3cd201ff08.tar.gz src-e64fe029e9d3ce476e77a478318e0c3cd201ff08.zip |
Diffstat (limited to 'contrib/libarchive/libarchive/archive_read_support_format_rar.c')
-rw-r--r-- | contrib/libarchive/libarchive/archive_read_support_format_rar.c | 17 |
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 |