From 02bda6d8d222d3e78a72bf24b5eaaf9161c076ba Mon Sep 17 00:00:00 2001 From: Julian Smith Date: Sat, 25 Dec 2021 23:21:42 +0000 Subject: [PATCH] src/MultiPlayer/multiplaymgr.cxx: avoid compiler warning for strncpy() call. --- src/MultiPlayer/multiplaymgr.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MultiPlayer/multiplaymgr.cxx b/src/MultiPlayer/multiplaymgr.cxx index a9c480567..e4018f1bd 100644 --- a/src/MultiPlayer/multiplaymgr.cxx +++ b/src/MultiPlayer/multiplaymgr.cxx @@ -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))