diff options
-rw-r--r-- | engines/sci/resource.h | 8 | ||||
-rw-r--r-- | engines/sci/resource_audio.cpp | 8 |
2 files changed, 5 insertions, 11 deletions
diff --git a/engines/sci/resource.h b/engines/sci/resource.h index 928d571dbc..e601a1c434 100644 --- a/engines/sci/resource.h +++ b/engines/sci/resource.h @@ -174,14 +174,10 @@ public: } Common::String toString() const { - char buf[32]; - - snprintf(buf, 32, "%s.%d", getResourceTypeName(_type), _number); - Common::String retStr = buf; + Common::String retStr = Common::String::format("%s.%d", getResourceTypeName(_type), _number); if (_tuple != 0) { - snprintf(buf, 32, "(%d, %d, %d, %d)", _tuple >> 24, (_tuple >> 16) & 0xff, (_tuple >> 8) & 0xff, _tuple & 0xff); - retStr += buf; + retStr += Common::String::format("(%d, %d, %d, %d)", _tuple >> 24, (_tuple >> 16) & 0xff, (_tuple >> 8) & 0xff, _tuple & 0xff); } return retStr; diff --git a/engines/sci/resource_audio.cpp b/engines/sci/resource_audio.cpp index 4b3a13c490..72096ff14d 100644 --- a/engines/sci/resource_audio.cpp +++ b/engines/sci/resource_audio.cpp @@ -511,10 +511,8 @@ void ResourceManager::setAudioLanguage(int language) { _audioMapSCI1 = NULL; } - char filename[9]; - snprintf(filename, 9, "AUDIO%03d", language); - - Common::String fullname = Common::String(filename) + ".MAP"; + Common::String filename = Common::String::format("AUDIO%03d", language); + Common::String fullname = filename + ".MAP"; if (!Common::File::exists(fullname)) { warning("No audio map found for language %i", language); return; @@ -524,7 +522,7 @@ void ResourceManager::setAudioLanguage(int language) { // Search for audio volumes for this language and add them to the source list Common::ArchiveMemberList files; - SearchMan.listMatchingMembers(files, Common::String(filename) + ".0??"); + SearchMan.listMatchingMembers(files, filename + ".0??"); for (Common::ArchiveMemberList::const_iterator x = files.begin(); x != files.end(); ++x) { const Common::String name = (*x)->getName(); const char *dot = strrchr(name.c_str(), '.'); |