Some bug fixes
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1008 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
9bdc18602a
commit
8f86fcdc82
@ -518,11 +518,9 @@ BString::UnlockBuffer(int32 length)
|
||||
|
||||
if (len < 0)
|
||||
len = strlen(_privateData);
|
||||
else if (len > Length())
|
||||
len = Length();
|
||||
|
||||
if (len > 0)
|
||||
_privateData = _ShrinkAtBy(len, Length() - len);
|
||||
if (len != Length())
|
||||
_privateData = _GrowBy(len - Length()); // Can be negative
|
||||
|
||||
return *this;
|
||||
}
|
||||
@ -690,7 +688,7 @@ BString::_OpenAtBy(int32 offset, int32 length)
|
||||
char*
|
||||
BString::_ShrinkAtBy(int32 offset, int32 length)
|
||||
{
|
||||
assert(offset + length < Length());
|
||||
assert(offset + length <= Length());
|
||||
int32 oldLength = Length();
|
||||
|
||||
memmove(_privateData + offset, _privateData + offset + length,
|
||||
|
Loading…
x
Reference in New Issue
Block a user