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:
Kari Argillander
2022-11-29 22:31:26 +02:00
committed by GitHub
parent 5a3d7a4ab2
commit 28644040e7
+1 -1
View File
@@ -678,7 +678,7 @@ static void PrintReadPropertyData(BACNET_OBJECT_TYPE object_type,
int iLast15idx =
value->type.Character_String.length - 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],
15);
value->type.Character_String.value[31] = 0;