Fix: Use memmove with overlapping data (#361)
We should use memmove instead of memcpy when things can overlap. I was looking little bit whole repo and this got my eye.
This commit is contained in:
+1
-1
@@ -678,7 +678,7 @@ static void PrintReadPropertyData(BACNET_OBJECT_TYPE object_type,
|
|||||||
int iLast15idx =
|
int iLast15idx =
|
||||||
value->type.Character_String.length - 15;
|
value->type.Character_String.length - 15;
|
||||||
value->type.Character_String.value[15] = '-';
|
value->type.Character_String.value[15] = '-';
|
||||||
memcpy(&value->type.Character_String.value[16],
|
memmove(&value->type.Character_String.value[16],
|
||||||
&value->type.Character_String.value[iLast15idx],
|
&value->type.Character_String.value[iLast15idx],
|
||||||
15);
|
15);
|
||||||
value->type.Character_String.value[31] = 0;
|
value->type.Character_String.value[31] = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user