u_char fsinfo[2 * DOSBOOTBLOCKSIZE];
u_char backup[DOSBOOTBLOCKSIZE];
int ret = FSOK;
-
+
if (read(dosfs, block, sizeof block) < sizeof block) {
perror("could not read boot block");
return FSFATAL;
}
if (block[510] != 0x55 || block[511] != 0xaa) {
- pfatal("Invalid signature in boot block: %02x%02x", block[511], block[510]);
+ pfatal("Invalid signature in boot block: %02x%02x",
+ block[511], block[510]);
return FSFATAL;
}
return 1;
- err:
+err:
free(*buffer);
return 0;
}
if (!_readfat(fs, boot, no, &buffer))
return FSFATAL;
-
+
fat = calloc(boot->NumClusters, sizeof(struct fatEntry));
if (fat == NULL) {
perror("No space for FAT");
ret |= FSDIRTY;
else {
/* just some odd byte sequence in FAT */
-
switch (boot->ClustMask) {
case CLUST32_MASK:
pwarn("%s (%02x%02x%02x%02x%02x%02x%02x%02x)\n",
break;
}
-
if (ask(1, "Correct"))
ret |= FSFIXFAT;
}
* into the first one.
*/
int
-comparefat(struct bootblock *boot, struct fatEntry *first,
+comparefat(struct bootblock *boot, struct fatEntry *first,
struct fatEntry *second, int fatnum)
{
cl_t cl;
free(old_fat);
p += count;
}
-
+
for (cl = CLUST_FIRST; cl < boot->NumClusters; cl++) {
switch (boot->ClustMask) {
case CLUST32_MASK:
cl_t head;
int mod = FSOK;
int ret;
-
+
for (head = CLUST_FIRST; head < boot->NumClusters; head++) {
/* find next untravelled chain */
if (fat[head].head != head