diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-06-18 16:07:27 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-06-18 16:07:27 (GMT) |
| commit | 8c608ee8b9d5d4913eb3a851cfd9c6f0a87e105d (patch) | |
| tree | d74a3d61d55ce7c9ab0daea371e33b0b0549300e /src/interface/Textbox.cpp | |
| parent | 7ffaa421d184ef63c9e34fa80b2438d1ec670161 (diff) | |
| download | powder-8c608ee8b9d5d4913eb3a851cfd9c6f0a87e105d.zip powder-8c608ee8b9d5d4913eb3a851cfd9c6f0a87e105d.tar.gz | |
Use C++ allocation/freeing for text masking and multiline processing
Diffstat (limited to 'src/interface/Textbox.cpp')
| -rw-r--r-- | src/interface/Textbox.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/interface/Textbox.cpp b/src/interface/Textbox.cpp index 4c0e267..4ea5bd0 100644 --- a/src/interface/Textbox.cpp +++ b/src/interface/Textbox.cpp @@ -129,10 +129,10 @@ void Textbox::OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool { if(masked) { - char * tempText = new char[text.length()]; + char * tempText = new char[text.length()+1]; std::fill(tempText, tempText+text.length(), 0x8d); tempText[text.length()] = 0; - displayText = tempText; + displayText = std::string(tempText); delete tempText; } else |
