Skip to content

Commit

Permalink
Fix string copy bug
Browse files Browse the repository at this point in the history
  • Loading branch information
DrFlibble committed Jun 20, 2024
1 parent ac21c61 commit 80f2177
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/libufc/datasources/xplane/xplaneclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,8 @@ bool XPlaneClient::sendRREF(std::vector<std::pair<int, std::string>> datarefs, i
string dataref = datarefs[i + j].second;
drefRequest.dref_freq = freq;
drefRequest.dref_sender_index = idx;
strncpy(drefRequest.dref_string, dataref.c_str(), 400);
strncpy(drefRequest.dref_string, dataref.c_str(), 399);
drefRequest.dref_string[399] = 0;
bool res = send(&drefRequest, sizeof(drefRequest));
if (!res)
{
Expand Down

0 comments on commit 80f2177

Please sign in to comment.