X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=extras%2Fvolume_id%2Fvolume_id%2Ffat%2Ffat.c;h=219207e81dc491a0a3cbc636405e124d76cb134f;hp=e6f01076ad28ec800520d96412895e0a8faaf7e5;hb=7979e3d4b7c56acee2fe0e9a9fefb3fe0d83771e;hpb=51df9ee4965516b17dcd50647546ee970df87b32 diff --git a/extras/volume_id/volume_id/fat/fat.c b/extras/volume_id/volume_id/fat/fat.c index e6f01076a..219207e81 100644 --- a/extras/volume_id/volume_id/fat/fat.c +++ b/extras/volume_id/volume_id/fat/fat.c @@ -166,22 +166,22 @@ int volume_id_probe_vfat(struct volume_id *id, __u64 off) /* believe only that's fat, don't trust the version * the cluster_count will tell us */ - if (strncmp(vs->sysid, "NTFS", 4) == 0) + if (memcmp(vs->sysid, "NTFS", 4) == 0) return -1; - if (strncmp(vs->type.fat32.magic, "MSWIN", 5) == 0) + if (memcmp(vs->type.fat32.magic, "MSWIN", 5) == 0) goto valid; - if (strncmp(vs->type.fat32.magic, "FAT32 ", 8) == 0) + if (memcmp(vs->type.fat32.magic, "FAT32 ", 8) == 0) goto valid; - if (strncmp(vs->type.fat.magic, "FAT16 ", 8) == 0) + if (memcmp(vs->type.fat.magic, "FAT16 ", 8) == 0) goto valid; - if (strncmp(vs->type.fat.magic, "MSDOS", 5) == 0) + if (memcmp(vs->type.fat.magic, "MSDOS", 5) == 0) goto valid; - if (strncmp(vs->type.fat.magic, "FAT12 ", 8) == 0) + if (memcmp(vs->type.fat.magic, "FAT12 ", 8) == 0) goto valid; /* @@ -272,10 +272,10 @@ valid: if (vs == NULL) return -1; - if (label != NULL && strncmp(label, "NO NAME ", 11) != 0) { + if (label != NULL && memcmp(label, "NO NAME ", 11) != 0) { volume_id_set_label_raw(id, label, 11); volume_id_set_label_string(id, label, 11); - } else if (strncmp(vs->type.fat.label, "NO NAME ", 11) != 0) { + } else if (memcmp(vs->type.fat.label, "NO NAME ", 11) != 0) { volume_id_set_label_raw(id, vs->type.fat.label, 11); volume_id_set_label_string(id, vs->type.fat.label, 11); } @@ -333,10 +333,10 @@ fat32: if (vs == NULL) return -1; - if (label != NULL && strncmp(label, "NO NAME ", 11) != 0) { + if (label != NULL && memcmp(label, "NO NAME ", 11) != 0) { volume_id_set_label_raw(id, label, 11); volume_id_set_label_string(id, label, 11); - } else if (strncmp(vs->type.fat32.label, "NO NAME ", 11) != 0) { + } else if (memcmp(vs->type.fat32.label, "NO NAME ", 11) != 0) { volume_id_set_label_raw(id, vs->type.fat32.label, 11); volume_id_set_label_string(id, vs->type.fat32.label, 11); }