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