[Scummvm-git-logs] scummvm master -> 03380c0e8a4daf13c51186bcebccccc983c9ed96

digitall 547637+digitall at users.noreply.github.com
Sat Oct 5 02:36:21 CEST 2019


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
03380c0e8a LAB: Replace memcpy of overlapping region with memmove


Commit: 03380c0e8a4daf13c51186bcebccccc983c9ed96
    https://github.com/scummvm/scummvm/commit/03380c0e8a4daf13c51186bcebccccc983c9ed96
Author: D G Turner (digitall at scummvm.org)
Date: 2019-10-05T01:32:41+01:00

Commit Message:
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.

Changed paths:
    engines/lab/engine.cpp


diff --git a/engines/lab/engine.cpp b/engines/lab/engine.cpp
index 11a6411..793a333 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;





More information about the Scummvm-git-logs mailing list