diff options
author | Strangerke | 2014-09-29 00:48:07 +0200 |
---|---|---|
committer | Strangerke | 2014-09-29 00:48:07 +0200 |
commit | 62b98913de165f6fd8663877911fe765fff9a852 (patch) | |
tree | c9ead816e1e36bf67f419eb0f0040f57e2b38f13 /engines/mads/nebular | |
parent | 1fe9038918d70da23e55231784afc6f99578e764 (diff) | |
download | scummvm-rg350-62b98913de165f6fd8663877911fe765fff9a852.tar.gz scummvm-rg350-62b98913de165f6fd8663877911fe765fff9a852.tar.bz2 scummvm-rg350-62b98913de165f6fd8663877911fe765fff9a852.zip |
MADS: Rex - Avoid potential not null terminated buffers after the use of strncpy
Diffstat (limited to 'engines/mads/nebular')
-rw-r--r-- | engines/mads/nebular/menu_nebular.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/engines/mads/nebular/menu_nebular.cpp b/engines/mads/nebular/menu_nebular.cpp index d76eb1279d..4f9493ade5 100644 --- a/engines/mads/nebular/menu_nebular.cpp +++ b/engines/mads/nebular/menu_nebular.cpp @@ -434,7 +434,7 @@ char TextView::_resourceName[100]; void TextView::execute(MADSEngine *vm, const Common::String &resName) { assert(resName.size() < 100); - strncpy(_resourceName, resName.c_str(), sizeof(_resourceName)); + Common::strlcpy(_resourceName, resName.c_str(), sizeof(_resourceName)); vm->_dialogs->_pendingDialog = DIALOG_TEXTVIEW; } @@ -496,7 +496,7 @@ void TextView::processLines() { processCommand(); // Copy rest of line (if any) to start of buffer - strncpy(_currentLine, cEnd + 1, sizeof(_currentLine)); + Common::strlcpy(_currentLine, cEnd + 1, sizeof(_currentLine)); cStart = strchr(_currentLine, '['); } @@ -788,7 +788,7 @@ char AnimationView::_resourceName[100]; void AnimationView::execute(MADSEngine *vm, const Common::String &resName) { assert(resName.size() < 100); - strncpy(_resourceName, resName.c_str(), sizeof(_resourceName)); + Common::strlcpy(_resourceName, resName.c_str(), sizeof(_resourceName)); vm->_dialogs->_pendingDialog = DIALOG_ANIMVIEW; } |