DefaultIOStream: Remove assert on empty count
fwrite() is valid to call with a 0 count, and will simply return 0.
See:
https://en.cppreference.com/w/cpp/io/c/fwrite
http://www.cplusplus.com/reference/cstdio/fwrite/
There are code paths where StreamWriter will call Tell(), which calls
Flush(), which calls Write(buffer.data(), 1, buffer.size()). This can
happen when nothing has yet been written to the buffer, so size is 0.
This commit is contained in:
@@ -100,7 +100,6 @@ size_t DefaultIOStream::Write(const void *pvBuffer,
|
||||
size_t pCount) {
|
||||
ai_assert(nullptr != pvBuffer);
|
||||
ai_assert(0 != pSize);
|
||||
ai_assert(0 != pCount);
|
||||
|
||||
return (mFile ? ::fwrite(pvBuffer, pSize, pCount, mFile) : 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user