Fix crash bug when pasting long text

darcs-hash:20051027152148-ac50b-b47b96bc8acae760ce53a2e42d23dc2d07bf2302.gz
This commit is contained in:
axel
2005-10-28 01:21:48 +10:00
parent 43213ee458
commit b78fba810c
3 changed files with 37 additions and 20 deletions

View File

@@ -1007,12 +1007,13 @@ static int insert_str(wchar_t *str)
}
else
{
int old_len = data->buff_len;
data->buff_len += len;
check_size();
/* Insert space for extra character at the right position */
if( data->buff_pos < data->buff_len )
/* Insert space for extra characters at the right position */
if( data->buff_pos < old_len )
{
memmove( &data->buff[data->buff_pos+len],
&data->buff[data->buff_pos],