chiark / gitweb /
[PATCH] udev_volume_id: volume_id version 032
[elogind.git] / extras / volume_id / volume_id / mac / mac.c
index 7265b288ab94446331d3682c13b10a16c34bfa54..5872b722b45d7e127a1858d52a5250caf0e36370 100644 (file)
@@ -64,8 +64,8 @@ int volume_id_probe_mac_partition_map(struct volume_id *id, __u64 off)
                return -1;
 
        part = (struct mac_partition *) buf;
-       if ((strncmp(part->signature, "PM", 2) == 0) &&
-           (strncmp(part->type, "Apple_partition_map", 19) == 0)) {
+       if ((memcmp(part->signature, "PM", 2) == 0) &&
+           (memcmp(part->type, "Apple_partition_map", 19) == 0)) {
                /* linux creates an own subdevice for the map
                 * just return the type if the drive header is missing */
                volume_id_set_usage(id, VOLUME_ID_PARTITIONTABLE);
@@ -74,7 +74,7 @@ int volume_id_probe_mac_partition_map(struct volume_id *id, __u64 off)
        }
 
        driver = (struct mac_driver_desc *) buf;
-       if (strncmp(driver->signature, "ER", 2) == 0) {
+       if (memcmp(driver->signature, "ER", 2) == 0) {
                /* we are on a main device, like a CD
                 * just try to probe the first partition from the map */
                unsigned int bsize = be16_to_cpu(driver->block_size);
@@ -87,7 +87,7 @@ int volume_id_probe_mac_partition_map(struct volume_id *id, __u64 off)
                        return -1;
 
                part = (struct mac_partition *) buf;
-               if (strncmp(part->signature, "PM", 2) != 0)
+               if (memcmp(part->signature, "PM", 2) != 0)
                        return -1;
 
                part_count = be32_to_cpu(part->map_count);
@@ -112,7 +112,7 @@ int volume_id_probe_mac_partition_map(struct volume_id *id, __u64 off)
                                return -1;
 
                        part = (struct mac_partition *) buf;
-                       if (strncmp(part->signature, "PM", 2) != 0)
+                       if (memcmp(part->signature, "PM", 2) != 0)
                                return -1;
 
                        poff = be32_to_cpu(part->start_block) * bsize;
@@ -123,9 +123,9 @@ int volume_id_probe_mac_partition_map(struct volume_id *id, __u64 off)
                        id->partitions[i].off = poff;
                        id->partitions[i].len = plen;
 
-                       if (strncmp(part->type, "Apple_Free", 10) == 0) {
+                       if (memcmp(part->type, "Apple_Free", 10) == 0) {
                                volume_id_set_usage_part(&id->partitions[i], VOLUME_ID_UNUSED);
-                       } else if (strncmp(part->type, "Apple_partition_map", 19) == 0) {
+                       } else if (memcmp(part->type, "Apple_partition_map", 19) == 0) {
                                volume_id_set_usage_part(&id->partitions[i], VOLUME_ID_PARTITIONTABLE);
                        } else {
                                volume_id_set_usage_part(&id->partitions[i], VOLUME_ID_UNPROBED);