diff --git a/cpp/s2pexec/s2pexec_core.cpp b/cpp/s2pexec/s2pexec_core.cpp index 47819649..1b94e8ec 100644 --- a/cpp/s2pexec/s2pexec_core.cpp +++ b/cpp/s2pexec/s2pexec_core.cpp @@ -230,10 +230,8 @@ bool S2pExec::ParseArguments(span 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) {