Skip to content

Commit

Permalink
address clang scan warning
Browse files Browse the repository at this point in the history
Change-Id: I6af3bd817e7c2d1f7c68ee463e27df42215072b5
  • Loading branch information
rdementi committed Nov 24, 2022
1 parent 9a96ce7 commit 1b16bb4
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions src/pcm-raw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1906,7 +1906,11 @@ int main(int argc, char* argv[])
argc--;
string arg_value;

if (check_argument_equals(*argv, {"--help", "-h", "/h"}))
if (*argv == nullptr)
{
continue;
}
else if (check_argument_equals(*argv, {"--help", "-h", "/h"}))
{
print_usage(program);
exit(EXIT_FAILURE);
Expand Down Expand Up @@ -2034,7 +2038,13 @@ int main(int argc, char* argv[])
{
argv++;
argc--;
if (addEvents(PMUConfigs, *argv) == false)
const auto p = *argv;
if (p == nullptr)
{
cerr << "ERROR: no parameter value provided for 'el' option\n";
exit(EXIT_FAILURE);
}
else if (addEvents(PMUConfigs, p) == false)
{
exit(EXIT_FAILURE);
}
Expand All @@ -2044,7 +2054,12 @@ int main(int argc, char* argv[])
{
argv++;
argc--;
if (addEvent(PMUConfigs[0], *argv) == false)
const auto p = *argv;
if (p == nullptr)
{
cerr << "ERROR: no parameter value provided for 'e' option\n";
exit(EXIT_FAILURE);
} else if (addEvent(PMUConfigs[0], p) == false)
{
exit(EXIT_FAILURE);
}
Expand Down

0 comments on commit 1b16bb4

Please sign in to comment.