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.
This commit is contained in:
parent
3911b56444
commit
03380c0e8a
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue