libsmartcols: don't sort if cmpfunc() is not set
Reported-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
This commit is contained in:
parent
7ad4b8503c
commit
8afabdb1fa
|
@ -1075,7 +1075,7 @@ static int cells_cmp_wrapper(struct list_head *a, struct list_head *b, void *dat
|
|||
*/
|
||||
int scols_sort_table(struct libscols_table *tb, struct libscols_column *cl)
|
||||
{
|
||||
if (!tb || !cl)
|
||||
if (!tb || !cl || !cl->cmpfunc)
|
||||
return -EINVAL;
|
||||
|
||||
DBG(TAB, ul_debugobj(tb, "sorting table"));
|
||||
|
|
Loading…
Reference in New Issue