Properly initialize stream::eof #7045

This commit is contained in:
Thomas Krijnen
2025-08-21 10:00:44 +02:00
parent 4cbf551c75
commit 2949a86f09
+2 -2
View File
@@ -178,7 +178,7 @@ IfcSpfStream::IfcSpfStream(const std::string& path)
IfcSpfStream::IfcSpfStream(std::istream& stream, int length)
: stream_(0),
buffer_(0) {
eof = false;
eof = length == 0;
size = length;
char* buffer_rw = new char[size];
stream.read(buffer_rw, size);
@@ -191,7 +191,7 @@ IfcSpfStream::IfcSpfStream(std::istream& stream, int length)
IfcSpfStream::IfcSpfStream(void* data, int length)
: stream_(0),
buffer_(0) {
eof = false;
eof = length == 0;
size = length;
buffer_ = (char*)data;
valid = true;