Skip to content

Commit e7f9801

Browse files
nilsfriessPierreMarchand20
authored andcommitted
Fix checks for correct number of arguments
1 parent de7cc4b commit e7f9801

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

examples/compression_comparison.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ int main(int argc, char *argv[]) {
6363
MPI_Init(&argc, &argv);
6464

6565
// Check the number of parameters
66-
if (argc < 3) {
66+
if (argc != 4) {
6767
// Tell the user how to run the program
6868
cerr << "Usage: " << argv[0] << " distance \b outputfile \b outputpath" << endl;
6969
/* "Usage messages" are a conventional way of telling the user

examples/use_clustering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ using namespace htool;
99
int main(int argc, char *argv[]) {
1010

1111
// Check the number of parameters
12-
if (argc < 1) {
12+
if (argc != 2) {
1313
// Tell the user how to run the program
1414
cerr << "Usage: " << argv[0] << " outputname" << endl;
1515
/* "Usage messages" are a conventional way of telling the user

examples/use_distributed_operator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ int main(int argc, char *argv[]) {
6464
MPI_Comm_size(MPI_COMM_WORLD, &sizeWorld);
6565

6666
// Check the number of parameters
67-
if (argc < 1) {
67+
if (argc != 2) {
6868
// Tell the user how to run the program
6969
cerr << "Usage: " << argv[0] << " outputpath" << endl;
7070
/* "Usage messages" are a conventional way of telling the user

examples/use_hmatrix.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class UserOperator : public VirtualGenerator<double> {
5959
int main(int argc, char *argv[]) {
6060

6161
// Check the number of parameters
62-
if (argc < 1) {
62+
if (argc != 2) {
6363
// Tell the user how to run the program
6464
cerr << "Usage: " << argv[0] << " outputpath" << endl;
6565
/* "Usage messages" are a conventional way of telling the user

0 commit comments

Comments
 (0)