PARALLACTION: Use Common::strlcpy instead of strncpy as suggested by LordHoto

This commit is contained in:
Eugene Sandulenko 2016-05-04 23:57:34 +02:00
parent b8f288873b
commit 8a3b57803f
3 changed files with 3 additions and 3 deletions

View File

@ -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);

View File

@ -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++;

View File

@ -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) {