diff options
Diffstat (limited to 'libarchive/test')
-rw-r--r-- | libarchive/test/test_write_format_zip_compression_store.c | 11 | ||||
-rw-r--r-- | libarchive/test/test_write_format_zip_file.c | 11 | ||||
-rw-r--r-- | libarchive/test/test_write_format_zip_file_zip64.c | 11 |
3 files changed, 3 insertions, 30 deletions
diff --git a/libarchive/test/test_write_format_zip_compression_store.c b/libarchive/test/test_write_format_zip_compression_store.c index aae50afb..4d086edf 100644 --- a/libarchive/test/test_write_format_zip_compression_store.c +++ b/libarchive/test/test_write_format_zip_compression_store.c @@ -132,21 +132,12 @@ static void verify_uncompressed_contents(const char *buff, size_t used) #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 /* p is the pointer to walk over the central directory, * q walks over the local headers, the data and the data descriptors. */ const char *p, *q, *local_header, *extra_start; #if defined(HAVE__LOCALTIME64_S) - tmptime = now; - terr = _localtime64_s(&tmbuf, &tmptime); - if (terr) - tm = NULL; - else - tm = &tmbuf; + tm = _localtime64_s(&tmbuf, &now) ? NULL : &tmbuf; #elif defined(HAVE_LOCALTIME_R) tm = localtime_r(&now, &tmbuf); #else 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 diff --git a/libarchive/test/test_write_format_zip_file_zip64.c b/libarchive/test/test_write_format_zip_file_zip64.c index 8e3b12e1..8a506226 100644 --- a/libarchive/test/test_write_format_zip_file_zip64.c +++ b/libarchive/test/test_write_format_zip_file_zip64.c @@ -79,10 +79,6 @@ DEFINE_TEST(test_write_format_zip_file_zip64) #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; @@ -100,12 +96,7 @@ DEFINE_TEST(test_write_format_zip_file_zip64) #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 |