Introduced use of local std::string to work around issue of the read header.text not being null terminated and causing a problem with the strstr call.

This commit is contained in:
Robert Osfield
2016-06-10 14:36:50 +01:00
parent 6a65b935fa
commit 38d91ca3fe

View File

@@ -475,11 +475,13 @@ osgDB::ReaderWriter::ReadResult ReaderWriterSTL::readNode(const std::string& fil
return ReadResult::ERROR_IN_READING_FILE;
}
std::string header_text(header.text, sizeof(header.text));
if (stb.st_size == expectLen)
{
isBinary = true;
}
else if (strstr(header.text, "solid") != 0)
else if (header_text.find("solid") != std::string::npos)
{
isBinary = false;
}