summaryrefslogtreecommitdiff
path: root/test_utils
diff options
context:
space:
mode:
authorRosen Penev <rosenp@gmail.com>2022-12-20 04:48:42 -0800
committerGitHub <noreply@github.com>2022-12-20 13:48:42 +0100
commit2d329073435d36065ce30bfd29428f6a45e41016 (patch)
tree66cf347dc278eb7a86ac02dfabb8858d8fd69538 /test_utils
parent3da2fb7ee2d929bc8f02bcf3d42def768667c939 (diff)
downloadlibarchive-2d329073435d36065ce30bfd29428f6a45e41016.tar.gz
cleanup _localtime64_s (#1820)
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Diffstat (limited to 'test_utils')
-rw-r--r--test_utils/test_main.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/test_utils/test_main.c b/test_utils/test_main.c
index 74250ad7..a733c9e5 100644
--- a/test_utils/test_main.c
+++ b/test_utils/test_main.c
@@ -2345,7 +2345,7 @@ static void assert_version_id(char **qq, size_t *ss)
q += 3;
s -= 3;
}
-
+
/* Skip a single trailing a,b,c, or d. */
if (*q == 'a' || *q == 'b' || *q == 'c' || *q == 'd')
++q;
@@ -2391,7 +2391,7 @@ void assertVersion(const char *prog, const char *base)
/* Version message should start with name of program, then space. */
assert(s > prog_len + 1);
-
+
failure("Version must start with '%s': ``%s''", base, p);
if (!assertEqualMem(q, base, prog_len)) {
free(p);
@@ -2729,7 +2729,7 @@ canNodump(void)
/* Get extended attribute value from a path */
void *
getXattr(const char *path, const char *name, size_t *sizep)
-{
+{
void *value = NULL;
#if ARCHIVE_XATTR_SUPPORT
ssize_t size;
@@ -3863,7 +3863,7 @@ main(int argc, char **argv)
int test_set[sizeof(tests) / sizeof(tests[0])];
int i = 0, j = 0, tests_run = 0, tests_failed = 0, option;
int testprogdir_len;
-#ifdef PROGRAM
+#ifdef PROGRAM
int tmp2_len;
#endif
time_t now;
@@ -4109,15 +4109,15 @@ main(int argc, char **argv)
*/
now = time(NULL);
for (i = 0; ; i++) {
-#if defined(HAVE_LOCALTIME_R)
- tmptr = localtime_r(&now, &tmbuf);
-#elif defined(HAVE__LOCALTIME64_S)
+#if defined(HAVE__LOCALTIME64_S)
tmptime = now;
terr = _localtime64_s(&tmbuf, &tmptime);
if (terr)
tmptr = NULL;
else
tmptr = &tmbuf;
+#elif defined(HAVE_LOCALTIME_R)
+ tmptr = localtime_r(&now, &tmbuf);
#else
tmptr = localtime(&now);
#endif