From 9f03ad60e58f7bdcac6a1046471a3374550ee384 Mon Sep 17 00:00:00 2001
From: Karel Zak <kzak@redhat.com>
Date: Thu, 13 Aug 2020 10:12:01 +0200
Subject: [PATCH] libfdisk: make fdisk_partname() more robust

---
 libfdisk/src/utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libfdisk/src/utils.c b/libfdisk/src/utils.c
index 6056e7f1f..38ad23393 100644
--- a/libfdisk/src/utils.c
+++ b/libfdisk/src/utils.c
@@ -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";
 	}
