diff options
| author | Erik Prabowo Kamal <erik@darapsa.org> | 2026-12-01 22:23:08 +0800 |
|---|---|---|
| committer | Erik Prabowo Kamal <erik@darapsa.org> | 2026-12-01 22:23:08 +0800 |
| commit | c44ce35e930a52aad0632c2db74f24144a48d572 (patch) | |
| tree | e02ea3bb42341388221af9e9a47e455f5f581bc2 /converter.c | |
| parent | facfa182423cba7e53d2972e5fd12a2dc2ba3f42 (diff) | |
and not just the last delimiter, just like one of the only 2
possible conditions below it.
Diffstat (limited to 'converter.c')
| -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 |