From 1c1b41b7a2a8e5b7715c32329e1e88afc37389c9 Mon Sep 17 00:00:00 2001 From: The Dax Date: Wed, 21 Aug 2013 11:28:25 -0400 Subject: [PATCH 1/2] Fix crash with CPU Speed Lock popup. --- UI/GameSettingsScreen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index ed462fd10c..d39e309719 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -157,7 +157,7 @@ EventReturn PopupSliderChoice::HandleClick(EventParams &e) { void PopupSliderChoice::Draw(UIContext &dc) { Choice::Draw(dc); - char temp[4]; + char temp[32]; sprintf(temp, "%i", *value_); dc.Draw()->DrawText(dc.theme->uiFont, temp, bounds_.x2() - 12, bounds_.centerY(), 0xFFFFFFFF, ALIGN_RIGHT | ALIGN_VCENTER); } From 70e7b879a271becc81c7f5738b5325a7d204dfbf Mon Sep 17 00:00:00 2001 From: The Dax Date: Wed, 21 Aug 2013 11:31:19 -0400 Subject: [PATCH 2/2] Expand this one too, to be safe, if more floating point precision is required. --- UI/GameSettingsScreen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index d39e309719..a0ddcf7efc 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -170,7 +170,7 @@ EventReturn PopupSliderChoiceFloat::HandleClick(EventParams &e) { void PopupSliderChoiceFloat::Draw(UIContext &dc) { Choice::Draw(dc); - char temp[5]; + char temp[32]; sprintf(temp, "%2.2f", *value_); dc.Draw()->DrawText(dc.theme->uiFont, temp, bounds_.x2() - 12, bounds_.centerY(), 0xFFFFFFFF, ALIGN_RIGHT | ALIGN_VCENTER); }