syoyo / tinyobjloader-c

Header only tiny wavefront .obj loader in pure C99

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Material name corruption in tinyobj_parse_obj

PeterOGB opened this issue · comments

When constructing a null terminated version of the material name, the last character is being overwritten due to wrong character index being used .
Line 1379:
material_name_null_term[commands[i].material_name_len-1] = 0;
should be
material_name_null_term[commands[i].material_name_len] = 0;

Good catch!

Your PR has been merged #35 , so I think this issue is ready to close.