diff --git a/src/detection/disk/disk.c b/src/detection/disk/disk.c index 3e92ca0eb..e712a9c12 100644 --- a/src/detection/disk/disk.c +++ b/src/detection/disk/disk.c @@ -2,9 +2,9 @@ const char* ffDetectDisksImpl(FFlist* disks); -static int compareDisks(const void* disk1, const void* disk2) +static int compareDisks(const FFDisk* disk1, const FFDisk* disk2) { - return ffStrbufCompAlphabetically(&((const FFDisk*) disk1)->mountpoint, &((const FFDisk*) disk2)->mountpoint); + return ffStrbufComp(&disk1->mountpoint, &disk2->mountpoint); } const char* ffDetectDisks(FFDiskOptions* options, FFlist* disks) @@ -18,7 +18,7 @@ const char* ffDetectDisks(FFDiskOptions* options, FFlist* disks) // For example for /boot/efi/bootmgr we need to check /boot/efi before /boot //Note that we sort alphabetically here for a better ordering when printing the list, // so the check must be done in reverse order - ffListSort(disks, compareDisks); + ffListSort(disks, (void*) compareDisks); FF_LIST_FOR_EACH(FFDisk, disk, *disks) { if(disk->bytesTotal == 0) diff --git a/src/util/FFstrbuf.h b/src/util/FFstrbuf.h index 1eb6a3edd..d26e1fff5 100644 --- a/src/util/FFstrbuf.h +++ b/src/util/FFstrbuf.h @@ -300,11 +300,6 @@ static inline int ffStrbufComp(const FFstrbuf* strbuf, const FFstrbuf* comp) return memcmp(strbuf->chars, comp->chars, length + 1); } -static inline int ffStrbufCompAlphabetically(const FFstrbuf* strbuf, const FFstrbuf* comp) -{ - return strcmp(strbuf->chars, comp->chars); -} - static inline FF_C_NODISCARD bool ffStrbufEqual(const FFstrbuf* strbuf, const FFstrbuf* comp) { return ffStrbufComp(strbuf, comp) == 0;