raziel23x / skyrim-plugin-decoding-project

Automatically exported from code.google.com/p/skyrim-plugin-decoding-project
1 stars 3 forks source link

Review Length Check #23

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What kind of length does this add?  Does it apply to only strings?

Original issue reported on code.google.com by danielhmpdx16@gmail.com on 2 Aug 2012 at 5:39

GoogleCodeExporter commented 9 years ago

Original comment by danielhmpdx16@gmail.com on 2 Aug 2012 at 5:46

GoogleCodeExporter commented 9 years ago
I can't remember where this was.  I thought the code review link added notes to 
the revision I am looking at currently.

Original comment by danielhmpdx16@gmail.com on 2 Aug 2012 at 6:58

GoogleCodeExporter commented 9 years ago
I think Revision r279

Original comment by danielhmpdx16@gmail.com on 2 Aug 2012 at 6:58

GoogleCodeExporter commented 9 years ago
You mean the lengths inside the RESX file?

Like this one:

{{{
<data name="tbX.MaxLength" type="System.Int32, mscorlib">
    <value>2</value>
}}}

That's just an UI thing: That sets the max length accepted by that TextBox 
control.

Is related to the control's text representation: if those controls are showing 
numbers, the max length is digits plus '.' and sign, f. ex.

Buy yeah, that's an ugly way of doing it, I concur.

Original comment by leandor@gmail.com on 12 Aug 2012 at 8:55

GoogleCodeExporter commented 9 years ago
No I mean the changes in GroupEditor.cs

Original comment by danielhmpdx16@gmail.com on 12 Aug 2012 at 9:02

GoogleCodeExporter commented 9 years ago
Ah, ok... this one then:

{{{
if (tbRecType.TextLength != 4)
{
    tbRecType.Focus();
    MessageBox.Show("Invalid parent record type. Needs to be 4 characters!");
    return;
}
data = new byte[4];
Encoding.CP1252.GetBytes(tbRecType.Text, 0, 4, data, 0);
}}}

Is that what you were referring? If that is, then I'll check the actual code...

Original comment by leandor@gmail.com on 12 Aug 2012 at 10:47

GoogleCodeExporter commented 9 years ago

Original comment by danielhmpdx16@gmail.com on 22 Sep 2012 at 11:49