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:
Karel Zak 2009-01-22 01:28:39 +01:00
parent 5bf9a2b139
commit 2d4f75767c
2 changed files with 5 additions and 2 deletions

View File

@ -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;

View File

@ -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;
}