@@ -209,7 +209,7 @@ struct SContext
209
209
}
210
210
else
211
211
{
212
- LineEndPointer = terminator;
212
+ LineEndPointer = terminator- 1 ;
213
213
WordLength = -1 ;
214
214
// return pointer to the start of the line
215
215
return StartPointer;
@@ -236,14 +236,14 @@ struct SContext
236
236
auto wordEnd = std::find_first_of (StartPointer,LineEndPointer,WhiteSpace.begin (),WhiteSpace.end ());
237
237
// null terminate the next word
238
238
if (wordEnd!=LineEndPointer)
239
- *wordEnd = ' \0 ' ;
239
+ *( wordEnd++) = ' \0 ' ;
240
240
// find next word
241
241
auto notWhiteSpace = [WhiteSpace](const char c)->bool
242
242
{
243
- return std::find (WhiteSpace.begin (),WhiteSpace.end (),c)! =WhiteSpace.end ();
243
+ return std::find (WhiteSpace.begin (),WhiteSpace.end (),c)= =WhiteSpace.end ();
244
244
};
245
245
auto nextWord = std::find_if (wordEnd,LineEndPointer,notWhiteSpace);
246
- WordLength = std::distance (StartPointer,wordEnd )-1 ;
246
+ WordLength = std::distance (StartPointer,nextWord )-1 ;
247
247
}
248
248
// return pointer to the start of current word
249
249
return StartPointer;
@@ -618,7 +618,7 @@ SAssetBundle CPLYMeshFileLoader::loadAsset(system::IFile* _file, const IAssetLoa
618
618
{
619
619
word = ctx.getNextWord ();
620
620
621
- if (! ctx.ElementList .empty ())
621
+ if (ctx.ElementList .empty ())
622
622
{
623
623
_params.logger .log (" PLY property token found before element %s" , system::ILogger::ELL_WARNING, word);
624
624
}
@@ -691,7 +691,10 @@ SAssetBundle CPLYMeshFileLoader::loadAsset(system::IFile* _file, const IAssetLoa
691
691
ctx.IsBinaryFile = true ;
692
692
ctx.IsWrongEndian = true ;
693
693
}
694
- else if (strcmp (word, " ascii" ))
694
+ else if (strcmp (word, " ascii" )==0 )
695
+ {
696
+ }
697
+ else
695
698
{
696
699
// abort if this isn't an ascii or a binary mesh
697
700
_params.logger .log (" Unsupported PLY mesh format %s" , system::ILogger::ELL_ERROR, word);
0 commit comments