You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When "sector % h->fat->sectors_per_cluster == 0" is true, we want to get the next cluster, then get the first sector of that cluster. However, this condition is broken when h->fat->first_data_sector is not zero. For example, sector = 208, h->fat->sectors_per_cluster = 4 , h->fat->first_data_sector = 1, where "sector % h->fat->sectors_per_cluster == 0" is true, but we can't say this sector(208) is the end of cluster, right?
so we need to minus the offset. Bug fix seems like this:
Firstly, thanks to the great work of openfat. I am using it in my own project.
Along my work with openfat, I met a error which was caused by bug here:
openfat/src/fat_core.c
Line 218 in 97362e1
When "sector % h->fat->sectors_per_cluster == 0" is true, we want to get the next cluster, then get the first sector of that cluster. However, this condition is broken when h->fat->first_data_sector is not zero. For example, sector = 208, h->fat->sectors_per_cluster = 4 , h->fat->first_data_sector = 1, where "sector % h->fat->sectors_per_cluster == 0" is true, but we can't say this sector(208) is the end of cluster, right?
so we need to minus the offset. Bug fix seems like this:
And I test above fix successfuly.
The text was updated successfully, but these errors were encountered: