diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2018-09-18 08:39:24 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2018-09-19 08:02:52 +0900 |
commit | 93bab288956f43c70f2b28a88efdc9effd951bb5 (patch) | |
tree | 453abf294f7bf2aba7ccf7ed37ccd669ec231c95 /src/shared/bootspec.c | |
parent | 6058516a14ada1748313af6783f5b4e7e3006654 (diff) | |
download | systemd-93bab288956f43c70f2b28a88efdc9effd951bb5.tar.gz systemd-93bab288956f43c70f2b28a88efdc9effd951bb5.tar.bz2 systemd-93bab288956f43c70f2b28a88efdc9effd951bb5.zip |
tree-wide: use typesafe_qsort()
Diffstat (limited to 'src/shared/bootspec.c')
-rw-r--r-- | src/shared/bootspec.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/shared/bootspec.c b/src/shared/bootspec.c index 47a7dbafbd..8d5a421144 100644 --- a/src/shared/bootspec.c +++ b/src/shared/bootspec.c @@ -202,10 +202,8 @@ int boot_loader_read_conf(const char *path, BootConfig *config) { return 0; } -static int boot_entry_compare(const void *a, const void *b) { - const BootEntry *aa = a, *bb = b; - - return str_verscmp(aa->filename, bb->filename); +static int boot_entry_compare(const BootEntry *a, const BootEntry *b) { + return str_verscmp(a->filename, b->filename); } int boot_entries_find(const char *dir, BootEntry **ret_entries, size_t *ret_n_entries) { @@ -234,7 +232,7 @@ int boot_entries_find(const char *dir, BootEntry **ret_entries, size_t *ret_n_en n++; } - qsort_safe(array, n, sizeof(BootEntry), boot_entry_compare); + typesafe_qsort(array, n, boot_entry_compare); *ret_entries = array; *ret_n_entries = n; |