修正ByteArray构造函数的一个BUG

This commit is contained in:
nnhy 2016-04-01 06:17:09 +00:00
parent 216d641640
commit b5cadce3a3
2 changed files with 5 additions and 3 deletions

View File

@ -86,7 +86,7 @@ bool BlockStorage::Write(uint address, const Buffer& bs) const
#else
byte bb[0x800];
#endif
Buffer ms(bb, ArrayLength(bb));
Buffer ms(bb, sizeof(bb));
ms.SetLength(Block);
// 写入第一个半块

View File

@ -706,12 +706,14 @@ bool operator!=(const Array& bs1, const Array& bs2)
ByteArray::ByteArray(int length) : Array(Arr, sizeof(Arr))
{
_Length = length;
//_Length = length;
SetLength(length);
}
ByteArray::ByteArray(byte item, int length) : Array(Arr, sizeof(Arr))
{
_Length = length;
//_Length = length;
SetLength(length);
Set(item, 0, length);
}