From f125dce608026b868fa2d705ecd1c15b3e0272ac Mon Sep 17 00:00:00 2001 From: Thierry Crozat Date: Sat, 10 Aug 2013 23:25:54 +0100 Subject: GUI: Initialise _hotkey in ButtonWidget constructor One of the two ButtonWidget constructor did not initialise _hotkey when given a non-null value. This caused valgrind to report an access to uninitialised variable in Dialog::handleKeyDown(). --- gui/widget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gui') diff --git a/gui/widget.cpp b/gui/widget.cpp index d97c46a5cc..e96b62e359 100644 --- a/gui/widget.cpp +++ b/gui/widget.cpp @@ -287,7 +287,7 @@ ButtonWidget::ButtonWidget(GuiObject *boss, int x, int y, int w, int h, const Co ButtonWidget::ButtonWidget(GuiObject *boss, const Common::String &name, const Common::String &label, const char *tooltip, uint32 cmd, uint8 hotkey) : StaticTextWidget(boss, name, cleanupHotkey(label), tooltip), CommandSender(boss), - _cmd(cmd), _lastTime(0) { + _cmd(cmd), _hotkey(hotkey), _lastTime(0) { if (hotkey == 0) _hotkey = parseHotkey(label); setFlags(WIDGET_ENABLED/* | WIDGET_BORDER*/ | WIDGET_CLEARBG); -- cgit v1.2.3