summaryrefslogtreecommitdiff
path: root/libarchive/test/test_write_format_zip_file.c
diff options
context:
space:
mode:
authorRosen Penev <rosenp@gmail.com>2022-12-28 14:05:16 -0800
committerGitHub <noreply@github.com>2022-12-28 23:05:16 +0100
commit2e9bcba70685383426ad42c8856c50ce3214ae24 (patch)
tree7c9e8e2499110a20559cddadc20f06424c2032f9 /libarchive/test/test_write_format_zip_file.c
parent1f35c466aaa9444335a1b854b0b7223b0d2346c2 (diff)
downloadlibarchive-2e9bcba70685383426ad42c8856c50ce3214ae24.tar.gz
further cleanup _localtime64_s (#1824)
These were missing from 2d329073435d36065ce30bfd29428f6a45e41016 Signed-off-by: Rosen Penev <rosenp@gmail.com> Signed-off-by: Rosen Penev <rosenp@gmail.com>
Diffstat (limited to 'libarchive/test/test_write_format_zip_file.c')
-rw-r--r--libarchive/test/test_write_format_zip_file.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/libarchive/test/test_write_format_zip_file.c b/libarchive/test/test_write_format_zip_file.c
index ff3c13dc..afd0eb6e 100644
--- a/libarchive/test/test_write_format_zip_file.c
+++ b/libarchive/test/test_write_format_zip_file.c
@@ -77,10 +77,6 @@ DEFINE_TEST(test_write_format_zip_file)
#if defined(HAVE_LOCALTIME_R) || defined(HAVE__LOCALTIME64_S)
struct tm tmbuf;
#endif
-#if defined(HAVE__LOCALTIME64_S)
- errno_t terr;
- __time64_t tmptime;
-#endif
size_t used, buffsize = 1000000;
unsigned long crc;
int file_perm = 00644;
@@ -99,12 +95,7 @@ DEFINE_TEST(test_write_format_zip_file)
#endif
#if defined(HAVE__LOCALTIME64_S)
- tmptime = t;
- terr = _localtime64_s(&tmbuf, &tmptime);
- if (terr)
- tm = NULL;
- else
- tm = &tmbuf;
+ tm = _localtime64_s(&tmbuf, &t) ? NULL : &tmbuf;
#elif defined(HAVE_LOCALTIME_R)
tm = localtime_r(&t, &tmbuf);
#else