diff --git a/src/sorting.c b/src/sorting.c index 182ba8d..52c2f88 100644 --- a/src/sorting.c +++ b/src/sorting.c @@ -174,14 +174,9 @@ int compare_extension( const void* operand_b ) { - if ( !operand_a || !operand_b ) - { - log_error( "invalid parameter to compare function" ); - exit( -EINVAL ); - } - directory_entry_t* a = *( directory_entry_t** )operand_a; directory_entry_t* b = *( directory_entry_t** )operand_b; + if ( !a->extension && !b->extension ) return 0; if ( !a->extension && b->extension ) return -1; if ( a->extension && !b->extension ) return 1;