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