1
0
Fork 0

src/MultiPlayer/multiplaymgr.cxx: avoid compiler warning for strncpy() call.

This commit is contained in:
Julian Smith 2021-12-25 23:21:42 +00:00
parent 3351a785be
commit 02bda6d8d2

View file

@ -1378,7 +1378,7 @@ FGMultiplayMgr::SendMyPosition(const FGExternalMotionData& motionInfo)
else
PosMsg->pad = 0;
strncpy(PosMsg->Model, fgGetString("/sim/model/path").c_str(), MAX_MODEL_NAME_LEN);
strncpy(PosMsg->Model, fgGetString("/sim/model/path").c_str(), MAX_MODEL_NAME_LEN-1);
PosMsg->Model[MAX_MODEL_NAME_LEN - 1] = '\0';
if (fgGetBool("/sim/freeze/replay-state", true)&&
fgGetBool("/sim/multiplay/freeze-on-replay",true))