aboutsummaryrefslogtreecommitdiff
path: root/engines/lab
diff options
context:
space:
mode:
authorD G Turner2019-10-05 01:32:41 +0100
committerD G Turner2019-10-05 01:32:41 +0100
commit03380c0e8a4daf13c51186bcebccccc983c9ed96 (patch)
tree98015cc6bf50b49b396e541470b6d952ad1c86b5 /engines/lab
parent3911b564448417cf52e7153339f3cb1714d0917d (diff)
downloadscummvm-rg350-03380c0e8a4daf13c51186bcebccccc983c9ed96.tar.gz
scummvm-rg350-03380c0e8a4daf13c51186bcebccccc983c9ed96.tar.bz2
scummvm-rg350-03380c0e8a4daf13c51186bcebccccc983c9ed96.zip
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.
Diffstat (limited to 'engines/lab')
-rw-r--r--engines/lab/engine.cpp2
1 files changed, 1 insertions, 1 deletions
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;