aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorColin Snover2016-11-22 13:24:29 -0600
committerColin Snover2016-12-03 12:21:55 -0600
commit273695a11ec03d9dbd5916b89966fe55936d8394 (patch)
treed6e3abc7baf476372de2182bea38eee74985a3ce /engines
parent9e1bf888b8b3095a844c636e78b0bf35708878a9 (diff)
downloadscummvm-rg350-273695a11ec03d9dbd5916b89966fe55936d8394.tar.gz
scummvm-rg350-273695a11ec03d9dbd5916b89966fe55936d8394.tar.bz2
scummvm-rg350-273695a11ec03d9dbd5916b89966fe55936d8394.zip
SCI: Remove use of snprintf
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/resource.h8
-rw-r--r--engines/sci/resource_audio.cpp8
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(), '.');