[parted-devel] [PATCH] correct the driver partition detection on mac disklabels

Olaf Hering olh at suse.de
Sat Apr 8 08:42:56 UTC 2006


Correct the detection of driver partitions on mac disklabels.
Search the whole type string for 'driver', not just the strlen of 'driver'.

---
 libparted/labels/mac.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: parted-mainline/libparted/labels/mac.c
===================================================================
--- parted-mainline.orig/libparted/labels/mac.c
+++ parted-mainline/libparted/labels/mac.c
@@ -384,8 +384,8 @@ strncasestr (const char* haystack, const
 	int	needle_size = strlen (needle);
 	int	i;
 
-	for (i = 0; needle[i] && i < n - needle_size; i++) {
-		if (strcasecmp (haystack + i, needle) == 0)
+	for (i = 0; haystack[i] && i < n - needle_size; i++) {
+		if (strncasecmp (haystack + i, needle, needle_size) == 0)
 			return 1;
 	}
 



More information about the parted-devel mailing list