aboutsummaryrefslogtreecommitdiff
path: root/sword1
diff options
context:
space:
mode:
Diffstat (limited to 'sword1')
-rw-r--r--sword1/control.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/sword1/control.cpp b/sword1/control.cpp
index c19b98843b..833a5cc00a 100644
--- a/sword1/control.cpp
+++ b/sword1/control.cpp
@@ -756,7 +756,9 @@ void Control::writeSavegameDescriptions(void) {
while (strlen((char*)_saveNames[_saveFiles - 1]) == 0)
_saveFiles--;
for (uint8 cnt = 0; cnt < _saveFiles; cnt++) {
- outf->write(_saveNames[cnt], strlen((char*)_saveNames[cnt]));
+ int len = strlen((char*)_saveNames[cnt]);
+ if (len > 0)
+ outf->write(_saveNames[cnt], len);
if (cnt < _saveFiles - 1)
outf->writeByte(10);
else