From 2d4f75767cd8fed92b674fd2c5841a64e18cb24c Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 22 Jan 2009 01:28:39 +0100 Subject: [PATCH] blkid: fix blkid_do_probe() Fix small non-sense from from a recent commit. Signed-off-by: Karel Zak --- libs/blkid/src/probe.c | 4 +++- libs/blkid/src/probers/luks.c | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/libs/blkid/src/probe.c b/libs/blkid/src/probe.c index 52719388..31f3df19 100644 --- a/libs/blkid/src/probe.c +++ b/libs/blkid/src/probe.c @@ -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; diff --git a/libs/blkid/src/probers/luks.c b/libs/blkid/src/probers/luks.c index f44de15b..2fe4ff3b 100644 --- a/libs/blkid/src/probers/luks.c +++ b/libs/blkid/src/probers/luks.c @@ -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; } -- 2.39.5