be sure to copy not too much data to buf
This commit is contained in:
parent
dda9e4ad8f
commit
91ce1c84d8
@ -14,6 +14,7 @@ History:
|
||||
#include <QDir>
|
||||
|
||||
|
||||
#include <algorithm> // min/max
|
||||
|
||||
|
||||
|
||||
@ -1048,7 +1049,7 @@ char T_datif::loadRecDataFromFrame()
|
||||
// only use as many bytes as maximally possible
|
||||
char buf[sizeof(struct T_dynamicCondition)];
|
||||
memset(buf, 0, sizeof(buf));
|
||||
memcpy(buf, receivedData, sizeof(struct T_dynamicCondition));
|
||||
memcpy(buf, receivedData, std::min(sizeof(receivedData), sizeof(struct T_dynamicCondition)));
|
||||
gpi_storeDynMachineConditions(buf);
|
||||
} else {
|
||||
gpi_storeDynMachineConditions(receivedData);
|
||||
|
Loading…
Reference in New Issue
Block a user