Commit 97a53407 authored by Brendan Gregg's avatar Brendan Gregg Committed by GitHub

Merge pull request #331 from caringi/fix_crash_wrong_parameters

Avoid crashing if mistakenly just '-d' or '-v' is used
parents 578bfb84 f2f67326
...@@ -152,6 +152,11 @@ int main(int argc, char *argv[]) ...@@ -152,6 +152,11 @@ int main(int argc, char *argv[])
{ {
// Script file // Script file
char *file_name = argv[optind]; char *file_name = argv[optind];
if (!file_name)
{
std::cerr << "USAGE: filename or -e 'program' required." << std::endl;
return 1;
}
err = driver.parse_file(file_name); err = driver.parse_file(file_name);
optind++; optind++;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment