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.pull/3326/head
parent
67a710efad
commit
84e342acd7
|
@ -100,7 +100,6 @@ size_t DefaultIOStream::Write(const void *pvBuffer,
|
||||||
size_t pCount) {
|
size_t pCount) {
|
||||||
ai_assert(nullptr != pvBuffer);
|
ai_assert(nullptr != pvBuffer);
|
||||||
ai_assert(0 != pSize);
|
ai_assert(0 != pSize);
|
||||||
ai_assert(0 != pCount);
|
|
||||||
|
|
||||||
return (mFile ? ::fwrite(pvBuffer, pSize, pCount, mFile) : 0);
|
return (mFile ? ::fwrite(pvBuffer, pSize, pCount, mFile) : 0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue