Bug in Password text
by J "hplus" W · in Torque Game Engine · 09/17/2006 (1:39 pm) · 5 replies
What's wrong with this code?
Hint: think "unsigned comparison".
if(mPasswordText)
{
for(U32 i = 0; i<mTextBuffer.length()-1; i++)
textBuffer.append(StringBuffer(mPasswordMask));
}Hint: think "unsigned comparison".
#2
The correct formulation (assuming this precondition) is:
Turns out, the "password" checkbox doesn't actually make the field draw stars instead of text, though, so there will be another bug report soon-ish.
09/17/2006 (2:59 pm)
Actually, it works fine when the length is one -- it just ignore the last element (which I believe ought to be a terminating null). It only locks up the machine when the length is 0.The correct formulation (assuming this precondition) is:
if(mPasswordText)
{
for(U32 i = 1; i<mTextBuffer.length(); i++)
textBuffer.append(StringBuffer(mPasswordMask));
}Turns out, the "password" checkbox doesn't actually make the field draw stars instead of text, though, so there will be another bug report soon-ish.
#3
09/17/2006 (9:58 pm)
Yeah I debated the 1 part, because I couldn't remember if the null terminator was being counted in .length() or not :)
#4
Huh? Did you search about this? It has been fixed by, to my knowledge, two people already. You can save some time right there :)
09/19/2006 (2:03 am)
Quote:
Turns out, the "password" checkbox doesn't actually make the field draw stars instead of text, though, so there will be another bug report soon-ish.
Huh? Did you search about this? It has been fixed by, to my knowledge, two people already. You can save some time right there :)
#5
For example, I found the talk about the new Max exporter a day after I updated the 1.4 exporter to properly handle system scale, for example -- I wonder if the 1.5 already does scale, or if I'll have to go and re-do it in the new code... The link I found to try the new version was dead, so I can't tell for myself.
09/19/2006 (8:54 am)
Yes, at this point I'm just waiting for the 1.5 upgrade.For example, I found the talk about the new Max exporter a day after I updated the 1.4 exporter to properly handle system scale, for example -- I wonder if the 1.5 already does scale, or if I'll have to go and re-do it in the new code... The link I found to try the new version was dead, so I can't tell for myself.
Torque 3D Owner Stephen Zepp
If the mTextBuffer length is zero or one, you have an infinite loop.