summaryrefslogtreecommitdiff
path: root/test_utils
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 /test_utils
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 'test_utils')
-rw-r--r--test_utils/test_main.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/test_utils/test_main.c b/test_utils/test_main.c
index a733c9e5..81b5002f 100644
--- a/test_utils/test_main.c
+++ b/test_utils/test_main.c
@@ -3871,10 +3871,6 @@ main(int argc, char **argv)
#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
char *refdir_alloc = NULL;
const char *progname;
char **saved_argv;
@@ -4110,12 +4106,7 @@ main(int argc, char **argv)
now = time(NULL);
for (i = 0; ; i++) {
#if defined(HAVE__LOCALTIME64_S)
- tmptime = now;
- terr = _localtime64_s(&tmbuf, &tmptime);
- if (terr)
- tmptr = NULL;
- else
- tmptr = &tmbuf;
+ tmptr = _localtime64_s(&tmbuf, &now) ? NULL : &tmbuf;
#elif defined(HAVE_LOCALTIME_R)
tmptr = localtime_r(&now, &tmbuf);
#else