chiark / gitweb /
[PATCH] udev_volume_id: volume_id version 032
[elogind.git] / extras / volume_id / volume_id / hfs / hfs.c
index 638aabadf28fb23f0650cb55b1a4d3aceb92723b..a4ae86b56a0c1b66d27731bd8d4f857b2ba5ba64 100644 (file)
@@ -178,11 +178,11 @@ int volume_id_probe_hfs_hfsplus(struct volume_id *id, __u64 off)
                 return -1;
 
        hfs = (struct hfs_mdb *) buf;
-       if (strncmp(hfs->signature, "BD", 2) != 0)
+       if (memcmp(hfs->signature, "BD", 2) != 0)
                goto checkplus;
 
        /* it may be just a hfs wrapper for hfs+ */
-       if (strncmp(hfs->embed_sig, "H+", 2) == 0) {
+       if (memcmp(hfs->embed_sig, "H+", 2) == 0) {
                alloc_block_size = be32_to_cpu(hfs->al_blk_size);
                dbg("alloc_block_size 0x%x", alloc_block_size);
 
@@ -216,9 +216,9 @@ int volume_id_probe_hfs_hfsplus(struct volume_id *id, __u64 off)
 
 checkplus:
        hfsplus = (struct hfsplus_vol_header *) buf;
-       if (strncmp(hfsplus->signature, "H+", 2) == 0)
+       if (memcmp(hfsplus->signature, "H+", 2) == 0)
                goto hfsplus;
-       if (strncmp(hfsplus->signature, "HX", 2) == 0)
+       if (memcmp(hfsplus->signature, "HX", 2) == 0)
                goto hfsplus;
        return -1;