diff options
| -rw-r--r-- | converter.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/converter.c b/converter.c index ded4f5d..d6a18f7 100644 --- a/converter.c +++ b/converter.c @@ -15,8 +15,9 @@ static void read_file(void *ctx, const char *filename, const int is_mtl, const c '/' #endif ); - char path[strlen(obj_filename) - (last_delim ? strlen(last_delim) + 1 : 0) + 1]; - if (is_mtl && last_delim) { + _Bool is_mtl_last_delim = is_mtl && last_delim; + char path[strlen(obj_filename) - (is_mtl_last_delim ? strlen(last_delim) + 1 : 0) + 1]; + if (is_mtl_last_delim) { last_delim[0] = '\0'; sprintf(path, "%s/%s", obj_filename, filename); } else |