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
1 changed files with 20 additions and 2 deletions

View File

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