diff --git a/code/PlyParser.cpp b/code/PlyParser.cpp index 6687ca9ed..7c2165983 100644 --- a/code/PlyParser.cpp +++ b/code/PlyParser.cpp @@ -436,7 +436,7 @@ bool PLY::DOM::ParseHeader (const char* pCur,const char** pCurOut,bool isBinary) *pCurOut = pCur; // parse all elements - while (true) + while ((*pCur) != '\0') { // skip all comments PLY::DOM::SkipComments(pCur,&pCur); diff --git a/code/STLLoader.cpp b/code/STLLoader.cpp index 6fedcd34a..987de89d0 100644 --- a/code/STLLoader.cpp +++ b/code/STLLoader.cpp @@ -308,6 +308,7 @@ void STLImporter::LoadASCIIFile() { if (3 == curVertex) { DefaultLogger::get()->error("STL: a facet with more than 3 vertices has been found"); + ++sz; } else { @@ -326,8 +327,10 @@ void STLImporter::LoadASCIIFile() break; } // else skip the whole identifier - else while (!::IsSpaceOrNewLine(*sz)) { - ++sz; + else { + do { + ++sz; + } while (!::IsSpaceOrNewLine(*sz)); } }