From 03380c0e8a4daf13c51186bcebccccc983c9ed96 Mon Sep 17 00:00:00 2001 From: D G Turner Date: Sat, 5 Oct 2019 01:32:41 +0100 Subject: LAB: Replace memcpy of overlapping region with memmove The result of using memcpy when source and destination overlap is not clearly defined, so use memmove instead which avoids this problem. --- engines/lab/engine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/lab') diff --git a/engines/lab/engine.cpp b/engines/lab/engine.cpp index 11a64114b5..793a333a54 100644 --- a/engines/lab/engine.cpp +++ b/engines/lab/engine.cpp @@ -825,7 +825,7 @@ void LabEngine::processMainButton(uint16 &curInv, uint16 &lastInv, uint16 &oldDi if (!intersect) { if (_numCrumbs == MAX_CRUMBS) { _numCrumbs = MAX_CRUMBS - 1; - memcpy(&_breadCrumbs[0], &_breadCrumbs[1], _numCrumbs * sizeof _breadCrumbs[0]); + memmove(&_breadCrumbs[0], &_breadCrumbs[1], _numCrumbs * sizeof _breadCrumbs[0]); } _breadCrumbs[_numCrumbs]._crumbRoomNum = _roomNum; -- cgit v1.2.3