mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-24 13:13:58 +00:00
PARALLACTION: Use Common::strlcpy instead of strncpy as suggested by LordHoto
This commit is contained in:
parent
b8f288873b
commit
8a3b57803f
@ -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);
|
||||
|
||||
|
@ -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++;
|
||||
|
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user