clang-tidy: address readability-else-after-return lint

This commit is contained in:
Ben Boeckel
2020-04-08 13:14:40 -04:00
parent f2a33107be
commit 37872088cf
2 changed files with 4 additions and 2 deletions

View File

@@ -21,7 +21,8 @@ int main(int argc, const char* argv[])
}
if (strcmp(str, substring_success) == 0) {
return EXIT_SUCCESS;
} else if (strcmp(str, substring_failure) == 0) {
}
if (strcmp(str, substring_failure) == 0) {
return EXIT_FAILURE;
}
fprintf(stderr, "Failed to find string '%s' in '%s'\n", substring_success,

View File

@@ -11,7 +11,8 @@ int main(int argc, char* argv[])
fprintf(stdout, "stdout from bad command line arg '-bad'\n");
fprintf(stderr, "stderr from bad command line arg '-bad'\n");
return 1;
} else if (strcmp(argv[i], "-error") == 0) {
}
if (strcmp(argv[i], "-error") == 0) {
// The real cppcheck allows to set the exitcode with --error-exitcode
result = 5;
}