aboutsummaryrefslogtreecommitdiff
path: root/engines/gob
diff options
context:
space:
mode:
Diffstat (limited to 'engines/gob')
-rw-r--r--engines/gob/resources.cpp5
-rw-r--r--engines/gob/save/savehandler.cpp3
-rw-r--r--engines/gob/sound/sound.cpp6
3 files changed, 4 insertions, 10 deletions
diff --git a/engines/gob/resources.cpp b/engines/gob/resources.cpp
index 92eec0ee25..d5497c25be 100644
--- a/engines/gob/resources.cpp
+++ b/engines/gob/resources.cpp
@@ -603,10 +603,7 @@ bool Resources::dumpResource(const Resource &resource, uint16 id,
Common::String fileName = _fileBase;
- char idStr[7];
-
- snprintf(idStr, 7, "_%05d", id);
- fileName += idStr;
+ fileName += Common::String::format("_%05d", id);
fileName += ".";
fileName += ext;
diff --git a/engines/gob/save/savehandler.cpp b/engines/gob/save/savehandler.cpp
index 9e46f1db6f..71de629f93 100644
--- a/engines/gob/save/savehandler.cpp
+++ b/engines/gob/save/savehandler.cpp
@@ -154,8 +154,7 @@ Common::String SlotFileIndexed::build(int slot) const {
if ((slot < 0) || (((uint32) slot) >= _slotCount))
return Common::String();
- char buf[4];
- snprintf(buf, sizeof(buf), "%02d", slot);
+ Common::String buf = Common::String::format("%02d", slot);
return _base + "." + _ext + buf;
}
diff --git a/engines/gob/sound/sound.cpp b/engines/gob/sound/sound.cpp
index 0ad17c1e33..212116f689 100644
--- a/engines/gob/sound/sound.cpp
+++ b/engines/gob/sound/sound.cpp
@@ -667,15 +667,13 @@ void Sound::bgPlay(const char *base, const char *ext, SoundType type, int count)
_bgatmos->stopBA();
_bgatmos->queueClear();
- int length = strlen(base) + 7;
- char *fileName = new char[length];
SoundDesc *sndDesc;
for (int i = 1; i <= count; i++) {
- snprintf(fileName, length, "%s%02d.%s", base, i, ext);
+ Common::String fileName = Common::String::format("%s%02d.%s", base, i, ext);
sndDesc = new SoundDesc;
- if (sampleLoad(sndDesc, type, fileName))
+ if (sampleLoad(sndDesc, type, fileName.c_str()))
_bgatmos->queueSample(*sndDesc);
else
delete sndDesc;