From a608f9bfddc21f47166e39c0ada5d93558e10dff Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Mon, 1 Aug 2016 23:46:35 -0700 Subject: [PATCH] fix trailing space issue in tinyobjloader/mtl files. --- examples/ThirdPartyLibs/Wavefront/tiny_obj_loader.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/ThirdPartyLibs/Wavefront/tiny_obj_loader.cpp b/examples/ThirdPartyLibs/Wavefront/tiny_obj_loader.cpp index 8479992d5..16b0522ea 100644 --- a/examples/ThirdPartyLibs/Wavefront/tiny_obj_loader.cpp +++ b/examples/ThirdPartyLibs/Wavefront/tiny_obj_loader.cpp @@ -366,6 +366,8 @@ std::string LoadMtl ( continue; } + linebuf = linebuf.substr(0, linebuf.find_last_not_of(" \t") + 1); + // Skip leading space. const char* token = linebuf.c_str(); token += strspn(token, " \t");