aboutsummaryrefslogtreecommitdiff
path: root/engines/sword2/controls.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sword2/controls.cpp')
-rw-r--r--engines/sword2/controls.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/engines/sword2/controls.cpp b/engines/sword2/controls.cpp
index 7428cbb534..c55cc72493 100644
--- a/engines/sword2/controls.cpp
+++ b/engines/sword2/controls.cpp
@@ -180,12 +180,12 @@ void FontRendererGui::fetchText(uint32 textId, byte *buf) {
byte *data = _vm->fetchTextLine(_vm->_resman->openResource(textId / SIZE), textId & 0xffff);
int i;
- for (i = 0; data[i + 2]; i++) {
- if (buf)
+ if (buf) {
+ for (i = 0; data[i + 2]; i++)
buf[i] = data[i + 2];
+ buf[i] = 0;
}
- buf[i] = 0;
_vm->_resman->closeResource(textId / SIZE);
}