PARALLACTION: Safer string manipulation

This commit is contained in:
Eugene Sandulenko 2016-05-28 15:26:07 +02:00
parent b16c5439b0
commit 506549ae45
3 changed files with 3 additions and 3 deletions

View File

@ -395,7 +395,7 @@ void Parallaction_ns::changeLocation() {
changeCharacter(locname.character());
}
strcpy(g_saveData1, locname.location());
Common::strlcpy(g_saveData1, locname.location(), 30);
parseLocation(g_saveData1);
if (_location._startPosition.x != -1000) {

View File

@ -93,7 +93,7 @@ void SaveLoad_ns::doLoadGame(uint16 slot) {
uint16 _si;
for (_si = 0; _si < _vm->_numLocations; _si++) {
s = f->readLine();
strcpy(_vm->_locationNames[_si], s.c_str());
Common::strlcpy(_vm->_locationNames[_si], s.c_str(), 32);
s = f->readLine();
_vm->_localFlags[_si] = atoi(s.c_str());

View File

@ -335,7 +335,7 @@ void SoundMan_ns::setMusicVolume(int value) {
}
void SoundMan_ns::setMusicFile(const char *filename) {
strcpy(_musicFile, filename);
Common::strlcpy(_musicFile, filename, PATH_LEN);
}
void SoundMan_ns::execute(int command, const char *parm = 0) {