blkid: fix blkid_do_probe()
Fix small non-sense from from a recent commit. Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
parent
5bf9a2b139
commit
2d4f75767c
|
@ -451,6 +451,7 @@ int blkid_do_probe(blkid_probe pr)
|
|||
for (i = 0; i < ARRAY_SIZE(idinfos); i++) {
|
||||
const struct blkid_idinfo *id;
|
||||
const struct blkid_idmag *mag;
|
||||
int hasmag = 0;
|
||||
|
||||
pr->idx = i;
|
||||
|
||||
|
@ -475,12 +476,13 @@ int blkid_do_probe(blkid_probe pr)
|
|||
DBG(DEBUG_LOWPROBE, printf(
|
||||
"\n --> magic at sboff=%u, kboff=%ld;",
|
||||
mag->sboff, mag->kboff));
|
||||
hasmag = 1;
|
||||
break;
|
||||
}
|
||||
mag++;
|
||||
}
|
||||
|
||||
if (id->magics && id->magics[0].magic)
|
||||
if (hasmag == 0 && id->magics && id->magics[0].magic)
|
||||
/* magic string(s) defined, but not found */
|
||||
continue;
|
||||
|
||||
|
|
|
@ -47,7 +47,8 @@ static int probe_luks(blkid_probe pr, const struct blkid_idmag *mag)
|
|||
if (header == NULL)
|
||||
return -1;
|
||||
|
||||
blkid_probe_strncpy_uuid(pr, (char *) header->uuid, sizeof(header->uuid));
|
||||
blkid_probe_strncpy_uuid(pr, (unsigned char *) header->uuid,
|
||||
sizeof(header->uuid));
|
||||
blkid_probe_sprintf_version(pr, "%u", le16_to_cpu(header->version));
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue