bugfix: only sort non-NULL array
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
ce4bfa4cc2
commit
da66093ef4
@ -322,6 +322,7 @@ mtp_get_file_list(dc_device_t *abstract, struct file_list *files)
|
|||||||
free(rawdevices);
|
free(rawdevices);
|
||||||
DEBUG(abstract->context, "Found %d files", files->nr);
|
DEBUG(abstract->context, "Found %d files", files->nr);
|
||||||
|
|
||||||
|
if (files->array)
|
||||||
qsort(files->array, files->nr, sizeof(struct fit_file), name_cmp);
|
qsort(files->array, files->nr, sizeof(struct fit_file), name_cmp);
|
||||||
return DC_STATUS_SUCCESS;
|
return DC_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user