fixed gettext to return correct string, and use a null character at the end.

This commit is contained in:
dcone%netscape.com 1998-10-09 21:46:01 +00:00
parent 7666f663a2
commit cb813e93f9

View File

@ -348,16 +348,19 @@ char *str;
thetext = WEGetText(mTE_Data);
len = WEGetTextLength(mTE_Data);
HLock(thetext);
str = new char[len];
//HLock(thetext);
str = new char[len+1];
for(i=0;i<len;i++)
str[i] = (*thetext)[i];
HUnlock(thetext);
str[len] = 0;
//HUnlock(thetext);
aTextBuffer.SetLength(0);
aTextBuffer.Append(str);
delete str;
aSize = aTextBuffer.Length();
delete [] str;
return NS_OK;
}