+ /*
+ * If the partition table is invalid or empty,
+ * check if this is a DOS PBR
+ */
+ if (slot != 4 || !part_count) {
+ if (!strncmp((char *)&buffer[DOS_PBR_FSTYPE_OFFSET],
+ "FAT", 3) ||
+ !strncmp((char *)&buffer[DOS_PBR32_FSTYPE_OFFSET],
+ "FAT32", 5))
+ return DOS_PBR; /* This is a DOS PBR and not an MBR */
+ }
+ if (slot == 4)
+ return DOS_MBR; /* This is an DOS MBR */
+
+ /* This is neither a DOS MBR nor a DOS PBR */
+ return -1;
+}