From 2a0104092d63a61b2cd43499c6534a3240159fb6 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 6 Jan 2020 21:11:59 +0100 Subject: [PATCH] - fixed uninitialized variable in savegame name entering menu. --- source/common/menu/menu.h | 1 - source/common/menu/menuinput.cpp | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/source/common/menu/menu.h b/source/common/menu/menu.h index 3349c600d..51458572c 100644 --- a/source/common/menu/menu.h +++ b/source/common/menu/menu.h @@ -717,7 +717,6 @@ class DTextEnterMenu : public DMenu FString mEnterString; int mEnterSize; - int mEnterPos; bool mInputGridOkay; int InputGridX; int InputGridY; diff --git a/source/common/menu/menuinput.cpp b/source/common/menu/menuinput.cpp index a0297eb85..8f7d07b7c 100644 --- a/source/common/menu/menuinput.cpp +++ b/source/common/menu/menuinput.cpp @@ -67,7 +67,7 @@ DTextEnterMenu::DTextEnterMenu(DMenu *parent, FFont *dpf, FString textbuffer, in : DMenu(parent) { mEnterString = textbuffer; - mEnterPos = maxlen; + mEnterSize = maxlen; mInputGridOkay = (showgrid && (m_showinputgrid == 0)) || (m_showinputgrid >= 1); if (mEnterString.Len() > 0) { @@ -116,7 +116,7 @@ bool DTextEnterMenu::Responder(event_t *ev) char ch = (char)ev->data1; if ((ev->subtype == EV_GUI_KeyDown || ev->subtype == EV_GUI_KeyRepeat) && ch == '\b') { - if (mEnterPos > 0) + if (mEnterString.Len() > 0) { mEnterString.DeleteLastCharacter(); }