Skip to content

Commit b793919

Browse files
committed
main.cpp: replaced std::exit() with return
1 parent 76df97f commit b793919

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

main.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,18 +77,18 @@ int main(int argc, char **argv)
7777
}
7878
} else if (filename) {
7979
std::cout << "error: multiple filenames specified" << std::endl;
80-
std::exit(1);
80+
return 1;
8181
} else {
8282
filename = arg;
8383
}
8484
}
8585

8686
if (error)
87-
std::exit(1);
87+
return 1;
8888

8989
if (quiet && error_only) {
9090
std::cout << "error: -e cannot be used in conjunction with -q" << std::endl;
91-
std::exit(1);
91+
return 1;
9292
}
9393

9494
if (!filename) {
@@ -102,7 +102,7 @@ int main(int argc, char **argv)
102102
std::cout << " -q Quiet mode (no output)." << std::endl;
103103
std::cout << " -is Use std::istream interface." << std::endl;
104104
std::cout << " -e Output errors only." << std::endl;
105-
std::exit(0);
105+
return 0;
106106
}
107107

108108
dui.removeComments = true;
@@ -115,7 +115,7 @@ int main(int argc, char **argv)
115115
std::ifstream f(filename);
116116
if (!f.is_open()) {
117117
std::cout << "error: could not open file '" << filename << "'" << std::endl;
118-
std::exit(1);
118+
return 1;
119119
}
120120
rawtokens = new simplecpp::TokenList(f, files,filename,&outputList);
121121
} else {

0 commit comments

Comments
 (0)