Skip to content

Commit f939cc7

Browse files
Apply suggestions from code review
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 034fe9d commit f939cc7

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

tests/unit.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3969,13 +3969,13 @@ static int test_ScpRecvCallback_Timestamp(void)
39693969

39703970
if (mkdtemp(tmpDir) == NULL)
39713971
return -851;
3972+
baseReady = 1;
39723973

39733974
basePath = realpath(tmpDir, NULL);
39743975
if (basePath == NULL) {
39753976
result = -852;
39763977
goto cleanup;
39773978
}
3978-
baseReady = 1;
39793979

39803980
ret = snprintf(filePath, sizeof(filePath), "%s/ts_file.txt", basePath);
39813981
if (!scpTestSnprintfOk(ret, sizeof(filePath))) {
@@ -4051,10 +4051,10 @@ static int test_ScpRecvCallback_Timestamp(void)
40514051
if (filePath[0] != '\0')
40524052
(void)remove(filePath);
40534053
free(basePath);
4054-
if (baseReady)
4055-
(void)rmdir(tmpDir);
40564054
if (origCwdSaved && chdir(origCwd) != 0 && result == 0)
40574055
result = -863;
4056+
if (baseReady)
4057+
(void)rmdir(tmpDir);
40584058
return result;
40594059
}
40604060

0 commit comments

Comments
 (0)