aboutsummaryrefslogtreecommitdiff
path: root/engines/drascula/saveload.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/drascula/saveload.cpp')
-rw-r--r--engines/drascula/saveload.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/engines/drascula/saveload.cpp b/engines/drascula/saveload.cpp
index 503d2ab639..2165662b66 100644
--- a/engines/drascula/saveload.cpp
+++ b/engines/drascula/saveload.cpp
@@ -49,8 +49,15 @@ bool DrasculaEngine::saveLoadScreen() {
error("Can't open %s file", fileEpa);
}
}
- for (n = 0; n < NUM_SAVES; n++)
- sav->readLine_OLD(names[n], 23);
+ int l;
+ for (n = 0; n < NUM_SAVES; n++) {
+ sav->readLine_NEW(names[n], 23);
+ // readLine_NEW also returns the newline character (\n),
+ // so we need to clear it here
+ l = strlen(names[n]);
+ if (l > 0 && names[n][l - 1] == '\n')
+ names[n][l - 1] = '\0';
+ }
delete sav;
loadPic("savescr.alg", bgSurface, HALF_PAL);