Crash Bug in ScintillaControl.GetLine()
Status: Beta
Brought to you by:
gserack
The original function sets up a buffer for line, but
requests line + 1 from the control, thereby returning an
incorrect result, and an exception if the buffer was too
small. The fixed function is:
unsafe public string GetLine( int line )
{
int sz = (int)SPerform(2153,(uint)line ,0);
byte[] buffer = new byte[sz+1];
fixed (byte* b = buffer)
SPerform( 2153 ,(uint)line , (uint)b );
return System.Text.UTF8Encoding.UTF8.GetString
(buffer,0,sz);
}