diff options
author | rodri <rgl@antares-labs.eu> | 2024-03-06 16:35:19 +0000 |
---|---|---|
committer | rodri <rgl@antares-labs.eu> | 2024-03-06 16:35:19 +0000 |
commit | b31caa3645abe9ebed7885ceb7f9f9eff0524ee6 (patch) | |
tree | 001206b345dab18ee570b625addc9f6a63df9fe3 | |
parent | ad65ff69d3ddeaf3b34cc9038bc28e79692f9656 (diff) | |
download | libobj-b31caa3645abe9ebed7885ceb7f9f9eff0524ee6.tar.gz libobj-b31caa3645abe9ebed7885ceb7f9f9eff0524ee6.tar.bz2 libobj-b31caa3645abe9ebed7885ceb7f9f9eff0524ee6.zip |
don't fail if there's no material file.
-rw-r--r-- | obj.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -281,11 +281,11 @@ objmtlparse(char *file) int nf; if((p = strrchr(curline.file, '/')) != nil) - snprint(buf, sizeof buf, "%.*s/%s", p-curline.file, curline.file, file); + snprint(buf, sizeof buf, "%.*s/%s", (int)(p-curline.file), curline.file, file); bin = Bopen(buf, OREAD); if(bin == nil) - sysfatal("Bopen: %r"); + return nil; ml = allocmtl(file); m = nil; @@ -728,7 +728,7 @@ Line2: *p = 0; if((obj->materials = objmtlparse(buf)) == nil){ error("objmtlparse: %r"); - goto error; + fprint(2, "%r"); } }else if(strcmp(buf, "usemtl") == 0){ while(isspace(c)) |