mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-20 23:21:20 +02:00
Use a heap allocation when hiding password text
This commit is contained in:
@@ -129,10 +129,11 @@ void Textbox::OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool
|
|||||||
{
|
{
|
||||||
if(masked)
|
if(masked)
|
||||||
{
|
{
|
||||||
char tempText[text.length()];
|
char * tempText = new char[text.length()];
|
||||||
memset(tempText, 0x8d, text.length());
|
std::fill(tempText, tempText+text.length(), 0x8d);
|
||||||
tempText[text.length()] = 0;
|
tempText[text.length()] = 0;
|
||||||
displayText = tempText;
|
displayText = tempText;
|
||||||
|
delete tempText;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user