Skip to content

Commit e4bb16c

Browse files
committed
[stduart] Fix exit code on help flag
Signed-off-by: AeroStun <24841307+AeroStun@users.noreply.github.com>
1 parent 4f5ea83 commit e4bb16c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

extra/samples/stduart/main.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ void print_help(const char* argv0) {
4141
}
4242

4343
int main(int argc, char** argv) {
44-
if (argc != 3) {
45-
print_help(argv[0]);
46-
return EXIT_FAILURE;
47-
} else if (argv[1] == "-h"sv || argv[1] == "--help"sv) {
44+
if (argc == 2 && (argv[1] == "-h"sv || argv[1] == "--help"sv)) {
4845
print_help(argv[0]);
4946
return EXIT_SUCCESS;
47+
} else if (argc != 3) {
48+
print_help(argv[0]);
49+
return EXIT_FAILURE;
5050
}
5151

5252
// Create the toolchain

0 commit comments

Comments
 (0)