fix crash loading hidden-valley.acc because of trailing white space on texture coordinates

git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@7120 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: 13d9131f6b34b06a7c5b8b71712a8aa359ee3eb4
Former-commit-id: 526bf47a52ceb9fc8140e5c2eba1f2d1eecd9691
This commit is contained in:
iobyte 2020-06-01 01:34:28 +00:00
parent 1cfdf20aff
commit bebec19544

View file

@ -472,6 +472,11 @@ osg::Node* ReaderWriterACC::readObject(std::istream& stream, FileData& fileData,
std::string strUVs;
std::getline(stream,strUVs);
// trim any trailing white space
size_t endpos = strUVs.find_last_not_of(" \n\r\t");
if (endpos != std::string::npos)
strUVs.resize(endpos + 1);
/*while(!strUVs.empty() && isspace(strUVs[strUVs.size()-1]))
strUVs.pop_back();*/
/*osg::notify(osg::FATAL) << "osgDB SPEED DREAMS reader: string nRefs texture vertex \""