Skip to content

Commit

Permalink
Update parsing arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
uweseimet committed Oct 22, 2024
1 parent a819b13 commit 70c64ab
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions cpp/s2pexec/s2pexec_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,8 @@ bool S2pExec::ParseArguments(span<char*> args)
}

if (!command.empty()) {
if (!initiator.empty()) {
if (!GetAsUnsignedInt(initiator, initiator_id) || initiator_id > 7) {
throw parser_exception("Invalid initiator ID: '" + initiator + "' (0-7)");
}
if (!initiator.empty() && (!GetAsUnsignedInt(initiator, initiator_id) || initiator_id > 7)) {
throw parser_exception("Invalid initiator ID: '" + initiator + "' (0-7)");
}

if (target_id == -1 && !reset_bus) {
Expand Down

0 comments on commit 70c64ab

Please sign in to comment.