X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=extras%2Fvolume_id%2Fvolume_id%2Fmac%2Fmac.c;h=5872b722b45d7e127a1858d52a5250caf0e36370;hp=7265b288ab94446331d3682c13b10a16c34bfa54;hb=7979e3d4b7c56acee2fe0e9a9fefb3fe0d83771e;hpb=51df9ee4965516b17dcd50647546ee970df87b32 diff --git a/extras/volume_id/volume_id/mac/mac.c b/extras/volume_id/volume_id/mac/mac.c index 7265b288a..5872b722b 100644 --- a/extras/volume_id/volume_id/mac/mac.c +++ b/extras/volume_id/volume_id/mac/mac.c @@ -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);