diff options
author | D G Turner | 2011-06-02 03:44:31 +0100 |
---|---|---|
committer | D G Turner | 2011-06-02 03:44:31 +0100 |
commit | 0d379b3783e368160476c78d31b05a9e9914e782 (patch) | |
tree | 03263a5a287dc616493a6c81f486938ad0e2e92b /engines/cine/detection.cpp | |
parent | 4b6c1a0c2b53fdb71090759fbd89a6852d84af4b (diff) | |
download | scummvm-rg350-0d379b3783e368160476c78d31b05a9e9914e782.tar.gz scummvm-rg350-0d379b3783e368160476c78d31b05a9e9914e782.tar.bz2 scummvm-rg350-0d379b3783e368160476c78d31b05a9e9914e782.zip |
CINE: Replace snprintf() usage with Common::String::format()
Safer and less portability issues.
Diffstat (limited to 'engines/cine/detection.cpp')
-rw-r--r-- | engines/cine/detection.cpp | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/engines/cine/detection.cpp b/engines/cine/detection.cpp index 0ef2c87288..64eee4574f 100644 --- a/engines/cine/detection.cpp +++ b/engines/cine/detection.cpp @@ -185,10 +185,7 @@ void CineMetaEngine::removeSaveState(const char *target, int slot) const { memset(saveNames, 0, sizeof(saveNames)); Common::InSaveFile *in; - char tmp[80]; - - snprintf(tmp, 80, "%s.dir", target); - in = g_system->getSavefileManager()->openForLoading(tmp); + in = g_system->getSavefileManager()->openForLoading(Common::String::format("%s.dir", target)); if (!in) return; @@ -202,12 +199,10 @@ void CineMetaEngine::removeSaveState(const char *target, int slot) const { strncpy(saveNames[slot], slotName, 20); // Update savegame descriptions - char indexFile[80]; - snprintf(indexFile, 80, "%s.dir", target); - + Common::String indexFile = Common::String::format("%s.dir", target); Common::OutSaveFile *out = g_system->getSavefileManager()->openForSaving(indexFile); if (!out) { - warning("Unable to open file %s for saving", indexFile); + warning("Unable to open file %s for saving", indexFile.c_str()); return; } @@ -246,12 +241,11 @@ Common::Error CineEngine::saveGameState(int slot, const char *desc) { currentSaveName[slot][sizeof(CommandeType) - 1] = 0; // Update savegame descriptions - char indexFile[80]; - snprintf(indexFile, 80, "%s.dir", _targetName.c_str()); + Common::String indexFile = Common::String::format("%s.dir", _targetName.c_str()); Common::OutSaveFile *fHandle = _saveFileMan->openForSaving(indexFile); if (!fHandle) { - warning("Unable to open file %s for saving", indexFile); + warning("Unable to open file %s for saving", indexFile.c_str()); return Common::kUnknownError; } |