Make the msdos signature (0x55 0xaa) at 510 and 511 optional when
the standard FAT magic string is present.
if (buf == NULL)
return -1;
- /* check signature */
- if (buf[510] != 0x55 || buf[511] != 0xaa)
- return -1;
-
vs = (struct vfat_super_block *) buf;
if (memcmp(vs->sysid, "NTFS", 4) == 0)
return -1;
if (memcmp(vs->type.fat.magic, "FAT12 ", 8) == 0)
goto magic;
+ /* check signature */
+ if (buf[510] != 0x55 || buf[511] != 0xaa)
+ return -1;
+
/* some old floppies don't have a magic, expect the boot jump address to match */
if ((vs->boot_jump[0] != 0xeb || vs->boot_jump[2] != 0x90) &&
vs->boot_jump[0] != 0xe9)