]> err.no Git - util-linux/commitdiff
blkid: fix blkid_do_probe()
authorKarel Zak <kzak@redhat.com>
Thu, 22 Jan 2009 00:28:39 +0000 (01:28 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 11 Feb 2009 22:35:23 +0000 (23:35 +0100)
Fix small non-sense from from a recent commit.

Signed-off-by: Karel Zak <kzak@redhat.com>
libs/blkid/src/probe.c
libs/blkid/src/probers/luks.c

index 5271938871b993c3f2d63d14611f50abd0d975a0..31f3df19ee232922d4cc94208301937dbe866f65 100644 (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;
 
index f44de15b3164c4a7caf9eab47764877c357b055b..2fe4ff3b4a128429f4be4e89bfbf359c69813875 100644 (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;
 }