From 73e8a49464ea1ecabcb10de68cf95cb9b93cb1bb Mon Sep 17 00:00:00 2001 From: BLooperZ Date: Tue, 26 Jan 2021 08:53:51 +0200 Subject: [PATCH] SCUMM: SMUSH: fix regression in hebrew text --- engines/scumm/smush/smush_font.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/engines/scumm/smush/smush_font.cpp b/engines/scumm/smush/smush_font.cpp index f76e14e0ad1..9e4124da48e 100644 --- a/engines/scumm/smush/smush_font.cpp +++ b/engines/scumm/smush/smush_font.cpp @@ -200,9 +200,8 @@ int SmushFont::draw2byte(byte *buffer, int dst_width, int x, int y, int idx) { void SmushFont::drawSubstring(const char *str, uint numBytesMax, byte *buffer, int dst_width, int x, int y) { if (_vm->_language == Common::HE_ISR) { - for (int i = strlen(str); i >= 0 && numBytesMax; i--) { - x += drawChar(buffer, dst_width, x, y, str[i]); - --numBytesMax; + for (int i = numBytesMax; i > 0; i--) { + x += drawChar(buffer, dst_width, x, y, str[i - 1]); } } else { for (int i = 0; str[i] != 0 && numBytesMax; ++i) {