Bug in TextField?

peter at transvirtual.com peter at transvirtual.com
Sun Dec 27 03:10:15 PST 1998


On Sat, 26 Dec 1998, David Jones wrote:
>I have found what might be a bug in our TextArea implementation:
>
..
>ta.append("abc\n");
>ta.append("def\n");
>..
>The problem seems to be in TextArea.breakLines().  If a newline is the
>last character in the text, then "i0" will equal "n" at the exit of the
>for loop.  The following if statement will not fire.  If it did, it would
>correctly create a zero-length string.
>
>Is this analysis correct?

Yep, that is correct. Simply exchange "if ( i0 < n )" with
"if ( i0 <= n )". Thanks.

-- Peter


More information about the kaffe mailing list