libfdisk: make fdisk_partname() more robust
This commit is contained in:
parent
3b87a9af49
commit
9f03ad60e5
|
@ -142,7 +142,7 @@ char *fdisk_partname(const char *dev, size_t partno)
|
||||||
|
|
||||||
/* devfs kludge - note: fdisk partition names are not supposed
|
/* devfs kludge - note: fdisk partition names are not supposed
|
||||||
to equal kernel names, so there is no reason to do this */
|
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;
|
w -= 4;
|
||||||
p = "part";
|
p = "part";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue