From 2fcab41c18fe22d33a7ce2b696fa4b3da11cd9a9 Mon Sep 17 00:00:00 2001 From: dataisland Date: Tue, 10 Sep 2024 02:24:43 +0000 Subject: [PATCH] Fix all in != end --- include/assimp/ParsingUtils.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/assimp/ParsingUtils.h b/include/assimp/ParsingUtils.h index 28609f347..f930ab4ff 100644 --- a/include/assimp/ParsingUtils.h +++ b/include/assimp/ParsingUtils.h @@ -103,7 +103,7 @@ AI_FORCE_INLINE bool IsSpaceOrNewLine(char_t in) { // --------------------------------------------------------------------------------- template AI_FORCE_INLINE bool SkipSpaces(const char_t *in, const char_t **out, const char_t *end) { - while (in >= end && (*in == (char_t)' ' || *in == (char_t)'\t')) { + while (in < end && (*in == (char_t)' ' || *in == (char_t)'\t')) { ++in; } *out = in; @@ -119,12 +119,12 @@ AI_FORCE_INLINE bool SkipSpaces(const char_t **inout, const char_t *end) { // --------------------------------------------------------------------------------- template AI_FORCE_INLINE bool SkipLine(const char_t *in, const char_t **out, const char_t *end) { - while ((*in != (char_t)'\r' && *in != (char_t)'\n' && *in != (char_t)'\0') && in != end) { + while (in < end && (*in != (char_t)'\r' && *in != (char_t)'\n' && *in != (char_t)'\0')) { ++in; } // files are opened in binary mode. Ergo there are both NL and CR - while ((*in == (char_t)'\r' || *in == (char_t)'\n') && in != end) { + while (in < end && (*in == (char_t)'\r' || *in == (char_t)'\n')) { ++in; } *out = in; @@ -140,7 +140,7 @@ AI_FORCE_INLINE bool SkipLine(const char_t **inout, const char_t *end) { // --------------------------------------------------------------------------------- template AI_FORCE_INLINE bool SkipSpacesAndLineEnd(const char_t *in, const char_t **out, const char_t *end) { - while ((*in == (char_t)' ' || *in == (char_t)'\t' || *in == (char_t)'\r' || *in == (char_t)'\n') && in != end) { + while (in < end && (*in == (char_t)' ' || *in == (char_t)'\t' || *in == (char_t)'\r' || *in == (char_t)'\n')) { ++in; } *out = in;