now checks the real lenght of the passed buffer in BTextView::Insert(). Seems to fix bug 675

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18967 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini
2006-09-28 13:08:01 +00:00
parent 83bf699b3f
commit 7d8ee43e80
+7 -4
View File
@@ -1105,9 +1105,13 @@ BTextView::Insert(int32 startOffset, const char *inText, int32 inLength,
CancelInputMethod();
// do we really need to do anything?
if (inLength < 1)
if (inText == NULL || inLength < 1)
return;
int32 realLength = strlen(inText);
if (inLength > realLength)
inLength = realLength;
if (startOffset > TextLength())
startOffset = TextLength();
@@ -3496,9 +3500,8 @@ BTextView::ActualTabWidth(float location) const
void
BTextView::DoInsertText(const char *inText, int32 inLength, int32 inOffset,
const text_run_array *inRuns,
_BTextChangeResult_ *outResult)
BTextView::DoInsertText(const char *inText, int32 inLength, int32 inOffset,
const text_run_array *inRuns, _BTextChangeResult_ *outResult)
{
CALLED();
}