fix starting with default values when no arguments are passed

This commit is contained in:
Akos Horvath 2022-07-19 21:09:43 +02:00
parent 9d08e7574f
commit f1da5df0bc

View File

@ -58,12 +58,15 @@ int main(int argc, char **argv)
} }
} }
try {
tcount = std::stoi(targ); if (!targ.empty() && !iarg.empty()) {
maxiter = std::stoi(iarg); try {
} catch(...) { tcount = std::stoi(targ);
std::cout << "Invalid arguments." << std::endl; maxiter = std::stoi(iarg);
exit(1); } catch(...) {
std::cout << "Invalid arguments." << std::endl;
exit(1);
}
} }
if (tcount == 0 || tcount < 0) if (tcount == 0 || tcount < 0)