diff options
author | D G Turner | 2011-06-02 02:20:51 +0100 |
---|---|---|
committer | D G Turner | 2011-06-02 02:20:51 +0100 |
commit | 8356656575b4c07229dc0e9bd97fa2f67573de73 (patch) | |
tree | 2d5884b8d2ab89ccae17c36fdb48cca9a98ab35b /engines/gob/sound | |
parent | 092142d8800f4b7f136098d9cbad6ee8d5ffbe8b (diff) | |
download | scummvm-rg350-8356656575b4c07229dc0e9bd97fa2f67573de73.tar.gz scummvm-rg350-8356656575b4c07229dc0e9bd97fa2f67573de73.tar.bz2 scummvm-rg350-8356656575b4c07229dc0e9bd97fa2f67573de73.zip |
GOB: Replace snprintf() usage with Common::String::format()
Safer and less portability issues.
Diffstat (limited to 'engines/gob/sound')
-rw-r--r-- | engines/gob/sound/sound.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
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; |