From 8356656575b4c07229dc0e9bd97fa2f67573de73 Mon Sep 17 00:00:00 2001 From: D G Turner Date: Thu, 2 Jun 2011 02:20:51 +0100 Subject: GOB: Replace snprintf() usage with Common::String::format() Safer and less portability issues. --- engines/gob/sound/sound.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'engines/gob/sound') 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; -- cgit v1.2.3