Use strrchr() when finding the '.' that begins the file extension.

Sometimes we encounter file paths like ../foo/bar.obj; searching from the end of
the string would yield the correct result.
pull/3300/head
Hill Ma 2020-06-28 15:58:20 -07:00
parent 879ff365fc
commit 0b18d27042
1 changed files with 1 additions and 1 deletions

View File

@ -376,7 +376,7 @@ int main(int argc, char **argv)
// Check and validate the specified model file extension. // Check and validate the specified model file extension.
model_file = argv[1]; model_file = argv[1];
const char* extension = strchr(model_file, '.'); const char* extension = strrchr(model_file, '.');
if (!extension) { if (!extension) {
print_error("Please provide a file with a valid extension."); print_error("Please provide a file with a valid extension.");
return EXIT_FAILURE; return EXIT_FAILURE;