Fix crash of "assimp info" with no parameters
parent
56b6446913
commit
219dbbd4af
|
@ -286,12 +286,6 @@ void PrintHierarchy(
|
|||
// -----------------------------------------------------------------------------------
|
||||
// Implementation of the assimp info utility to print basic file info
|
||||
int Assimp_Info(const char *const *params, unsigned int num) {
|
||||
// --help
|
||||
if (!strcmp(params[0], "-h") || !strcmp(params[0], "--help") || !strcmp(params[0], "-?")) {
|
||||
printf("%s", AICMD_MSG_INFO_HELP_E);
|
||||
return AssimpCmdError::Success;
|
||||
}
|
||||
|
||||
// asssimp info <file> [-r]
|
||||
if (num < 1) {
|
||||
printf("assimp info: Invalid number of arguments. "
|
||||
|
@ -299,6 +293,12 @@ int Assimp_Info(const char *const *params, unsigned int num) {
|
|||
return AssimpCmdError::InvalidNumberOfArguments;
|
||||
}
|
||||
|
||||
// --help
|
||||
if (!strcmp(params[0], "-h") || !strcmp(params[0], "--help") || !strcmp(params[0], "-?")) {
|
||||
printf("%s", AICMD_MSG_INFO_HELP_E);
|
||||
return AssimpCmdError::Success;
|
||||
}
|
||||
|
||||
const std::string in = std::string(params[0]);
|
||||
|
||||
// get -r and -v arguments
|
||||
|
|
Loading…
Reference in New Issue