Fixed potential missing argument when using tv subcommand with argv[2]

This commit is contained in:
Jeffrey Walton 2015-06-12 10:39:55 -04:00
parent 5b1f23c310
commit 15d312e986

View File

@ -251,7 +251,7 @@ int CRYPTOPP_API main(int argc, char *argv[])
DigestFile(argv[2]);
else if (command == "tv")
{
std::string fname = argv[2];
std::string fname = (argc >= 3 ? argv[2] : "all");
if (fname.find(".txt") == std::string::npos)
fname = "TestVectors/" + fname + ".txt";
return !RunTestDataFile(fname.c_str());