diff options
author | Max Horn | 2009-09-01 13:01:59 +0000 |
---|---|---|
committer | Max Horn | 2009-09-01 13:01:59 +0000 |
commit | 197e68ef2ac0af202046130a7af7ef4f32aa831f (patch) | |
tree | c65f07ede9f34fbf0f32939f69a2ebd496d0c73e /engines/scumm/he/script_v60he.cpp | |
parent | 19d55c04903e331b940f4a4695b0a984bb44d2f2 (diff) | |
download | scummvm-rg350-197e68ef2ac0af202046130a7af7ef4f32aa831f.tar.gz scummvm-rg350-197e68ef2ac0af202046130a7af7ef4f32aa831f.tar.bz2 scummvm-rg350-197e68ef2ac0af202046130a7af7ef4f32aa831f.zip |
SCUMM: Better fix for convertFilePath (use snprintf instead of sprintf, avoid intermediate buffer)
svn-id: r43879
Diffstat (limited to 'engines/scumm/he/script_v60he.cpp')
-rw-r--r-- | engines/scumm/he/script_v60he.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/engines/scumm/he/script_v60he.cpp b/engines/scumm/he/script_v60he.cpp index 0048160980..8ade78c1b5 100644 --- a/engines/scumm/he/script_v60he.cpp +++ b/engines/scumm/he/script_v60he.cpp @@ -122,10 +122,8 @@ int ScummEngine_v60he::convertFilePath(byte *dst, int dstSize) { int r = 0; if (dst[len - 3] == 's' && dst[len - 2] == 'g') { // Save Game File // Change filename prefix to target name, for save game files. - char saveName[40]; - memset(saveName, 0, sizeof(saveName)); - sprintf(saveName, "%s.sg%c", _targetName.c_str(), dst[len - 1]); - memcpy(dst, saveName, 40); + const char c = dst[len - 1]; + snprintf((char *)dst, dstSize, "%s.sg%c", _targetName.c_str(), c); } else if (dst[0] == '.' && dst[1] == '/') { // Game Data Path // The default game data path is set to './' by ScummVM r = 2; |