Skip to content

Commit

Permalink
Fix: substr takes length instead of end position
Browse files Browse the repository at this point in the history
  • Loading branch information
matt77hias committed Sep 19, 2018
1 parent 17b63b8 commit b6a3b7c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions MAGE/Rendering/src/loaders/obj/obj_reader.tpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,11 @@ namespace mage::rendering::loader {
flag2
};
const std::string_view tokens[] = {
// If offset std::string::npos + 1u == 0u then count is don't-care;
// all unsigned values avoid exception.
token.substr(0u, slash1),
token.substr(slash1 + 1u, slash2),
token.substr(slash2 + 1u, token.size())
token.substr(slash1 + 1u, slash2 - slash1 - 1u),
token.substr(slash2 + 1u, token.size() - slash2 - 1u)
};

U32x3 indices;
Expand Down

0 comments on commit b6a3b7c

Please sign in to comment.