Skip to content

Commit

Permalink
Avoid copying to output string if tag item is not AT3 type
Browse files Browse the repository at this point in the history
  • Loading branch information
EightSmart committed Jul 18, 2024
1 parent bd8db48 commit c4f42d6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion AT3/AT3Tags.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ void AT3Tags::OnGetTagItem(CFlightPlan FlightPlan, CRadarTarget RadarTarget, int
return;
}

bool isAT3Item = true;

*pColorCode = TAG_COLOR_RGB_DEFINED;
switch (FlightPlan.GetState()) {
case FLIGHT_PLAN_STATE_NON_CONCERNED:
Expand Down Expand Up @@ -245,10 +247,13 @@ void AT3Tags::OnGetTagItem(CFlightPlan FlightPlan, CRadarTarget RadarTarget, int
break;
default:
tagOutput = "";
isAT3Item = false;
}

// Convert string output to character array
strcpy_s(sItemString, 16, tagOutput.substr(0, 15).c_str());
if (isAT3Item) {
strcpy_s(sItemString, 16, tagOutput.substr(0, 15).c_str());
}
}

void AT3Tags::OnTimer(int Counter) {
Expand Down

0 comments on commit c4f42d6

Please sign in to comment.