fix starting with default values when no arguments are passed
This commit is contained in:
parent
9d08e7574f
commit
f1da5df0bc
3
main.cpp
3
main.cpp
@ -58,6 +58,8 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (!targ.empty() && !iarg.empty()) {
|
||||||
try {
|
try {
|
||||||
tcount = std::stoi(targ);
|
tcount = std::stoi(targ);
|
||||||
maxiter = std::stoi(iarg);
|
maxiter = std::stoi(iarg);
|
||||||
@ -65,6 +67,7 @@ int main(int argc, char **argv)
|
|||||||
std::cout << "Invalid arguments." << std::endl;
|
std::cout << "Invalid arguments." << std::endl;
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (tcount == 0 || tcount < 0)
|
if (tcount == 0 || tcount < 0)
|
||||||
tcount = 4;
|
tcount = 4;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user