return -1;
if (startblock + getsize > total_sector) {
- debug("error: overflow occurs\n");
+ printf("error: overflow occurs\n");
return -1;
}
}
break;
}
- debug("FAT%d: ret: %08x, offset: %04x\n",
- mydata->fatsize, ret, offset);
+ debug("FAT%d: ret: %08x, entry: %08x, offset: %04x\n",
+ mydata->fatsize, ret, entry, offset);
return ret;
}
debug("Error: reading boot sector\n");
return -1;
}
-
+#ifdef CONFIG_FAT_WRITE
+ if (total_sector == 0) {
+ total_sector = next_part_offset - part_offset;
+ }
+#endif
root_cluster = bs.root_cluster;
if (mydata->fatsize == 32)