Skip to content

Commit

Permalink
Fix segfault when trace tag is missing after -t option (#104)
Browse files Browse the repository at this point in the history
Added error handling to check for a missing trace tag after the -t
option. Now displays an appropriate error message instead of causing a
segmentation fault.
  • Loading branch information
ofecisrael authored Dec 13, 2024
1 parent 6542f2c commit 216d384
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ int main( int argc, char* argv[] )
}
else if (arg=="-t")
{
if (i >= nargs)
{
EO_FATAL() << "Error: Missing trace tag.";
}
std::string targ(argv[i]);
i++;
#ifdef EO_TRACING
Expand Down

0 comments on commit 216d384

Please sign in to comment.