Fix a crash in DSPTool on malformed command line

This commit is contained in:
Silent 2019-06-23 20:32:32 +02:00
parent 9eab3feddf
commit 5f0b4d8da5
No known key found for this signature in database
GPG Key ID: AE53149BB0C45AF1

View File

@ -400,21 +400,39 @@ int main(int argc, const char* argv[])
{ {
const std::string argument = argv[i]; const std::string argument = argv[i];
if (argument == "-d") if (argument == "-d")
{
disassemble = true; disassemble = true;
}
else if (argument == "-o") else if (argument == "-o")
output_name = argv[++i]; {
if (++i < argc)
output_name = argv[i];
}
else if (argument == "-h") else if (argument == "-h")
output_header_name = argv[++i]; {
if (++i < argc)
output_header_name = argv[i];
}
else if (argument == "-c") else if (argument == "-c")
{
compare = true; compare = true;
}
else if (argument == "-s") else if (argument == "-s")
{
outputSize = true; outputSize = true;
}
else if (argument == "-m") else if (argument == "-m")
{
multiple = true; multiple = true;
}
else if (argument == "-f") else if (argument == "-f")
{
force = true; force = true;
}
else if (argument == "-p") else if (argument == "-p")
{
print_results = true; print_results = true;
}
else if (argument == "-ps") else if (argument == "-ps")
{ {
print_results = true; print_results = true;