From e0c95ede50a5ca08cb5246acb9e9ae32236de234 Mon Sep 17 00:00:00 2001 From: Joel Davis Date: Fri, 30 Jun 2017 23:37:19 -0700 Subject: [PATCH] Prevent bogus triangle being added when there is whitespace at end of .OBJ file --- src/models.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/models.c b/src/models.c index 0a692f5c..8a70a811 100644 --- a/src/models.c +++ b/src/models.c @@ -1637,6 +1637,7 @@ static Mesh LoadOBJ(const char *fileName) // NOTE: faces MUST be defined as TRIANGLES (3 vertex per face) while (!feof(objFile)) { + dataType = '\0'; fscanf(objFile, "%c", &dataType); switch (dataType)