diff --git a/apps/wolfsshd/test/test_configuration.c b/apps/wolfsshd/test/test_configuration.c index aa5c410de..fd58ed690 100644 --- a/apps/wolfsshd/test/test_configuration.c +++ b/apps/wolfsshd/test/test_configuration.c @@ -80,7 +80,7 @@ static void CleanupWildcardTest(void) WSNPRINTF(filepath, sizeof filepath, "%.*s%.*s", (int)prefixLen, "./sshd_config.d/", (int)maxNameLen, d->d_name); - WREMOVE(0, filepath); + (void)WREMOVE(0, filepath); } } WCLOSEDIR(NULL, &dir); @@ -110,8 +110,7 @@ static int SetupWildcardTest(void) "./sshd_config.d/"); } - WFOPEN(NULL, &f, filepath, "w"); - if (f) { + if (WFOPEN(NULL, &f, filepath, "w") == 0 && f != NULL) { word32 sz, wr; char contents[20]; WSNPRINTF(contents, sizeof contents, "LoginGraceTime %02u", @@ -1100,8 +1099,7 @@ static int test_IncludeRecursionBound(void) const char* normalContents = "Port 22\n"; word32 sz, wr; - WFOPEN(NULL, &f, loopPath, "w"); - if (f == NULL) { + if (WFOPEN(NULL, &f, loopPath, "w") != 0 || f == NULL) { Log(" Could not create %s.\n", loopPath); return WS_FATAL_ERROR; } @@ -1109,13 +1107,12 @@ static int test_IncludeRecursionBound(void) wr = (word32)WFWRITE(NULL, loopContents, sizeof(char), sz, f); WFCLOSE(NULL, f); if (sz != wr) { - WREMOVE(0, loopPath); + (void)WREMOVE(0, loopPath); return WS_FATAL_ERROR; } - WFOPEN(NULL, &f, normalPath, "w"); - if (f == NULL) { - WREMOVE(0, loopPath); + if (WFOPEN(NULL, &f, normalPath, "w") != 0 || f == NULL) { + (void)WREMOVE(0, loopPath); Log(" Could not create %s.\n", normalPath); return WS_FATAL_ERROR; } @@ -1123,8 +1120,8 @@ static int test_IncludeRecursionBound(void) wr = (word32)WFWRITE(NULL, normalContents, sizeof(char), sz, f); WFCLOSE(NULL, f); if (sz != wr) { - WREMOVE(0, loopPath); - WREMOVE(0, normalPath); + (void)WREMOVE(0, loopPath); + (void)WREMOVE(0, normalPath); return WS_FATAL_ERROR; } @@ -1156,8 +1153,8 @@ static int test_IncludeRecursionBound(void) } wolfSSHD_ConfigFree(conf); - WREMOVE(0, loopPath); - WREMOVE(0, normalPath); + (void)WREMOVE(0, loopPath); + (void)WREMOVE(0, normalPath); return ret; }