libfdisk: make fdisk_partname() more robust

This commit is contained in:
Karel Zak 2020-08-13 10:12:01 +02:00
parent 3b87a9af49
commit 9f03ad60e5
1 changed files with 1 additions and 1 deletions

View File

@ -142,7 +142,7 @@ char *fdisk_partname(const char *dev, size_t partno)
/* devfs kludge - note: fdisk partition names are not supposed
to equal kernel names, so there is no reason to do this */
if (strcmp(dev + w - 4, "disc") == 0) {
if (endswith(dev, "disc")) {
w -= 4;
p = "part";
}