From 8a3b57803fe94f16bd3d89fae4d117555b87e21f Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 4 May 2016 23:57:34 +0200 Subject: PARALLACTION: Use Common::strlcpy instead of strncpy as suggested by LordHoto --- engines/parallaction/objects.cpp | 2 +- engines/parallaction/parallaction.cpp | 2 +- engines/parallaction/parallaction_br.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'engines/parallaction') diff --git a/engines/parallaction/objects.cpp b/engines/parallaction/objects.cpp index 68890cda50..8f895f1532 100644 --- a/engines/parallaction/objects.cpp +++ b/engines/parallaction/objects.cpp @@ -163,7 +163,7 @@ int16 Program::findLocal(const char* name) { int16 Program::addLocal(const char *name, int16 value, int16 min, int16 max) { assert(_numLocals < NUM_LOCALS); - strncpy(_localNames[_numLocals], name, 10); + Common::strlcpy(_localNames[_numLocals], name, 10); _locals[_numLocals].setRange(min, max); _locals[_numLocals].setValue(value); diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp index e11aeed0f0..bbe759dffe 100644 --- a/engines/parallaction/parallaction.cpp +++ b/engines/parallaction/parallaction.cpp @@ -210,7 +210,7 @@ void Parallaction::allocateLocationSlot(const char *name) { error("No more location slots available. Please report this immediately to ScummVM team"); if (_currentLocationIndex == -1) { - strncpy(_locationNames[_numLocations], name, 10); + Common::strlcpy(_locationNames[_numLocations], name, 10); _currentLocationIndex = _numLocations; _numLocations++; diff --git a/engines/parallaction/parallaction_br.cpp b/engines/parallaction/parallaction_br.cpp index 78131c4ec8..9f045cb397 100644 --- a/engines/parallaction/parallaction_br.cpp +++ b/engines/parallaction/parallaction_br.cpp @@ -320,7 +320,7 @@ void Parallaction_br::changeLocation() { freeLocation(false); // load new location - strncpy(_location._name, _newLocationName.c_str(), 100); + Common::strlcpy(_location._name, _newLocationName.c_str(), 100); parseLocation(_location._name); if (_location._startPosition.x != -1000) { -- cgit v1.2.3