AGI: Replaced odd usage of sprintf() with strcpy()

Fixes an odd bug with savegame names being truncated in MSVC
This commit is contained in:
Filippos Karapetis 2011-09-25 18:36:33 +03:00
parent 18a0214672
commit c02603fce2

View file

@ -557,7 +557,7 @@ void AgiEngine::getSavegameDescription(int num, char *buf, bool showEmpty) {
Common::InSaveFile *in;
debugC(4, kDebugLevelMain | kDebugLevelSavegame, "Current game id is %s", _targetName.c_str());
sprintf(fileName, "%s", getSavegameFilename(num));
strcpy(fileName, getSavegameFilename(num));
if (!(in = _saveFileMan->openForLoading(fileName))) {
debugC(4, kDebugLevelMain | kDebugLevelSavegame, "File %s does not exist", fileName);
@ -852,7 +852,7 @@ int AgiEngine::saveGameDialog() {
return errOK;
}
sprintf(fileName, "%s", getSavegameFilename(_firstSlot + slot));
strcpy(fileName, getSavegameFilename(_firstSlot + slot));
debugC(8, kDebugLevelMain | kDebugLevelResources, "file is [%s]", fileName);
// Make sure all graphics was blitted to screen. This fixes bug