aboutsummaryrefslogtreecommitdiff
path: root/engines/dm/objectman.cpp
diff options
context:
space:
mode:
authorStrangerke2016-09-12 20:52:04 +0200
committerStrangerke2016-09-12 20:52:04 +0200
commit3be1c24af88db19eee5d76ae88d51aaefdc0ec13 (patch)
tree6cc09216ffbc8663bdcff2d11ecfc3485f377b7d /engines/dm/objectman.cpp
parentc4e362bf04caed73e06e964b4faa1715dd235a6d (diff)
downloadscummvm-rg350-3be1c24af88db19eee5d76ae88d51aaefdc0ec13.tar.gz
scummvm-rg350-3be1c24af88db19eee5d76ae88d51aaefdc0ec13.tar.bz2
scummvm-rg350-3be1c24af88db19eee5d76ae88d51aaefdc0ec13.zip
DM: Fix a couple of string manipulations into fix-sized buffer
Diffstat (limited to 'engines/dm/objectman.cpp')
-rw-r--r--engines/dm/objectman.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/engines/dm/objectman.cpp b/engines/dm/objectman.cpp
index 7e403be6fe..ffab2392c3 100644
--- a/engines/dm/objectman.cpp
+++ b/engines/dm/objectman.cpp
@@ -235,29 +235,29 @@ void ObjectMan::drawIconInSlotBox(uint16 slotBoxIndex, int16 iconIndex) {
}
void ObjectMan::drawLeaderObjectName(Thing thing) {
- char *objectName = nullptr;
+ Common::String objectName;
int16 iconIndex = getIconIndex(thing);
if (iconIndex == kDMIconIndiceJunkChampionBones) {
Junk *junk = (Junk*)_vm->_dungeonMan->getThingData(thing);
- char champBonesName[16];
+ Common::String champBonesName;
switch (_vm->getGameLanguage()) { // localized
case Common::FR_FRA:
// Fix original bug: strcpy was coming after strcat
- strcpy(champBonesName, _objectNames[iconIndex]);
- strcat(champBonesName, _vm->_championMan->_champions[junk->getChargeCount()]._name);
+ champBonesName = Common::String(_objectNames[iconIndex]);
+ champBonesName += Common::String(_vm->_championMan->_champions[junk->getChargeCount()]._name);
break;
default: // English and German version are the same
- strcpy(champBonesName, _vm->_championMan->_champions[junk->getChargeCount()]._name);
- strcat(champBonesName, _objectNames[iconIndex]);
+ champBonesName = Common::String(_vm->_championMan->_champions[junk->getChargeCount()]._name);
+ champBonesName += Common::String(_objectNames[iconIndex]);
break;
}
objectName = champBonesName;
} else
- objectName = _objectNames[iconIndex];
+ objectName = Common::String(_objectNames[iconIndex]);
- _vm->_textMan->printWithTrailingSpaces(_vm->_displayMan->_bitmapScreen, k160_byteWidthScreen, 233, 37, k4_ColorCyan, k0_ColorBlack, objectName, k14_ObjectNameMaximumLength, k200_heightScreen);
+ _vm->_textMan->printWithTrailingSpaces(_vm->_displayMan->_bitmapScreen, k160_byteWidthScreen, 233, 37, k4_ColorCyan, k0_ColorBlack, objectName.c_str(), k14_ObjectNameMaximumLength, k200_heightScreen);
}
IconIndice ObjectMan::getIconIndexInSlotBox(uint16 slotBoxIndex) {