diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-06-12 18:10:43 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-06-12 18:10:43 (GMT) |
| commit | 7f921924f56f3beb569fd1d8c2f233fbb7f895ea (patch) | |
| tree | 9694e32aa602ba165467c1d7518b6e446e36bd7f /src/interface/Textbox.cpp | |
| parent | 5144451b308f0700eb45e53e3c7c598aa7b4c4bd (diff) | |
| download | powder-7f921924f56f3beb569fd1d8c2f233fbb7f895ea.zip powder-7f921924f56f3beb569fd1d8c2f233fbb7f895ea.tar.gz | |
Use a heap allocation when hiding password text
Diffstat (limited to 'src/interface/Textbox.cpp')
| -rw-r--r-- | src/interface/Textbox.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
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 { |
