From 7f921924f56f3beb569fd1d8c2f233fbb7f895ea Mon Sep 17 00:00:00 2001 From: Simon Robertshaw Date: Tue, 12 Jun 2012 19:10:43 +0100 Subject: Use a heap allocation when hiding password text diff --git a/src/interface/Textbox.cpp b/src/interface/Textbox.cpp index 9db4dc6..4c0e267 100644 --- a/src/interface/Textbox.cpp +++ b/src/interface/Textbox.cpp @@ -129,10 +129,11 @@ void Textbox::OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool { if(masked) { - char tempText[text.length()]; - memset(tempText, 0x8d, text.length()); + char * tempText = new char[text.length()]; + std::fill(tempText, tempText+text.length(), 0x8d); tempText[text.length()] = 0; displayText = tempText; + delete tempText; } else { -- cgit v0.9.2-21-gd62e