motorcontrol: avoid unterminated strings

Signed-off-by: MarkusVolk <f_l_k@t-online.de>
This commit is contained in:
MarkusVolk
2020-01-14 08:55:44 +01:00
committed by Thilo Graf
parent 07c991e25e
commit 740624220b

View File

@@ -118,7 +118,7 @@ int CMotorControl::exec(CMenuTarget* parent, const std::string &)
CZapitClient::commandSetScanSatelliteList sat;
sat.position = CServiceManager::getInstance()->GetSatellitePosition(scansettings.satName);
strncpy(sat.satName, scansettings.satName.c_str(), sizeof(sat.satName));
strncpy(sat.satName, scansettings.satName.c_str(), sizeof(sat.satName)-1);
satList.push_back(sat);
satellite_map_t & satmap = frontend->getSatellites();