VE.Direct: prefer strncpy over strcpy

strcpy is not safe.
This commit is contained in:
Bernhard Kirchen 2024-05-29 14:07:59 +02:00
parent 88314f93c2
commit 63370e8a83

View File

@ -242,12 +242,12 @@ void VeDirectFrameHandler<T>::processTextData(std::string const& name, std::stri
} }
if (name == "SER") { if (name == "SER") {
strcpy(_tmpFrame.serialNr_SER, value.c_str()); strncpy(_tmpFrame.serialNr_SER, value.c_str(), sizeof(_tmpFrame.serialNr_SER));
return; return;
} }
if (name == "FW") { if (name == "FW") {
strcpy(_tmpFrame.firmwareVer_FW, value.c_str()); strncpy(_tmpFrame.firmwareVer_FW, value.c_str(), sizeof(_tmpFrame.firmwareVer_FW));
return; return;
} }