[Scummvm-git-logs] scummvm master -> 288ea5783e3f2bbd491020f6b589c2853f90113a
sev-
sev at scummvm.org
Sun Oct 13 15:29:34 CEST 2019
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
288ea5783e GRAPHICS: MACGUI: Fix assertion if shortcut in menu element is a last symbol
Commit: 288ea5783e3f2bbd491020f6b589c2853f90113a
https://github.com/scummvm/scummvm/commit/288ea5783e3f2bbd491020f6b589c2853f90113a
Author: Marisa-Chan (thunder_8888 at mail.ru)
Date: 2019-10-13T15:29:25+02:00
Commit Message:
GRAPHICS: MACGUI: Fix assertion if shortcut in menu element is a last symbol
Changed paths:
graphics/macgui/macmenu.cpp
diff --git a/graphics/macgui/macmenu.cpp b/graphics/macgui/macmenu.cpp
index d8fc4a6..87298e2 100644
--- a/graphics/macgui/macmenu.cpp
+++ b/graphics/macgui/macmenu.cpp
@@ -629,7 +629,10 @@ static void underlineAccelerator(ManagedSurface *dst, const Font *font, const Co
Common::U32String s(str);
- s.erase(shortcutPos + 1);
+ // Erase characters only if it is not end of the string
+ if ((uint)(shortcutPos + 1) < s.size())
+ s.erase(shortcutPos + 1);
+
int pos2 = font->getStringWidth(s);
s.deleteLastChar();
int pos1 = font->getStringWidth(s);
More information about the Scummvm-git-logs
mailing list