Skip to content

Commit f6a7d61

Browse files
committed
MemStream Assert fix
1 parent 7f3602c commit f6a7d61

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/libkiwi/core/kiwiMemStream.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ void MemStream::SeekImpl(ESeekDir dir, s32 offset) {
126126
s32 MemStream::ReadImpl(void* pDst, u32 size) {
127127
K_ASSERT_PTR(pDst);
128128

129-
K_ASSERT_EX(GetPosition() + size < GetSize(),
129+
K_ASSERT_EX(GetPosition() + size <= GetSize(),
130130
"Read past the end of the stream");
131131

132132
std::memcpy(pDst, mpBuffer + mPosition, size);
@@ -143,7 +143,7 @@ s32 MemStream::ReadImpl(void* pDst, u32 size) {
143143
s32 MemStream::WriteImpl(const void* pSrc, u32 size) {
144144
K_ASSERT_PTR(pSrc);
145145

146-
K_ASSERT_EX(GetPosition() + size < GetSize(),
146+
K_ASSERT_EX(GetPosition() + size <= GetSize(),
147147
"Write past the end of the stream");
148148

149149
std::memcpy(mpBuffer + mPosition, pSrc, size);

0 commit comments

Comments
 (0)