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