* fix typo (hs vs. hbb)
* set id->{version,usage,type} when all tests pass
* be paranoid and don't use hs->version when "hs" source buffer was
possibly modified by next volume_id_get_buffer() call.
Signed-off-by: Karel Zak <kzak@redhat.com>
struct hpfs_super *hs;
struct hpfs_spare_super *hss;
struct hpfs_boot_block *hbb;
struct hpfs_super *hs;
struct hpfs_spare_super *hss;
struct hpfs_boot_block *hbb;
info("probing at offset 0x%" PRIx64 "\n", off);
info("probing at offset 0x%" PRIx64 "\n", off);
if (memcmp(hss->magic, "\x49\x18\x91\xf9", 4) != 0)
return -1;
if (memcmp(hss->magic, "\x49\x18\x91\xf9", 4) != 0)
return -1;
- sprintf(id->type_version, "%u", hs->version);
- volume_id_set_usage(id, VOLUME_ID_FILESYSTEM);
- id->type = "hpfs";
/* if boot block looks valid, read label and uuid from there */
hbb = (struct hpfs_boot_block *) volume_id_get_buffer(id, off, 0x200);
/* if boot block looks valid, read label and uuid from there */
hbb = (struct hpfs_boot_block *) volume_id_get_buffer(id, off, 0x200);
return -1;
if (memcmp(hbb->magic, "\x55\xaa", 2) == 0 &&
memcmp(hbb->sig_hpfs, "HPFS", 4) == 0 &&
return -1;
if (memcmp(hbb->magic, "\x55\xaa", 2) == 0 &&
memcmp(hbb->sig_hpfs, "HPFS", 4) == 0 &&
volume_id_set_label_string(id, hbb->vol_label, 11);
volume_id_set_uuid(id, hbb->vol_serno, 0, UUID_DOS);
}
volume_id_set_label_string(id, hbb->vol_label, 11);
volume_id_set_uuid(id, hbb->vol_serno, 0, UUID_DOS);
}
+ sprintf(id->type_version, "%u", version);
+ volume_id_set_usage(id, VOLUME_ID_FILESYSTEM);
+ id->type = "hpfs";