tmolteno / openfat Goto Github PK
View Code? Open in Web Editor NEWGPL v3 Fat Filesystem Code
GPL v3 Fat Filesystem Code
When files or directories are created with OpenFAT, long file name entries are written to the parent directory. These are visible to Linux and OpenFAT, but Windows only shows the short 8.3 filenames.
Hi, a warning:
../openfat/src/fat_core.c: In function '_fat_get_next_cluster':
../openfat/src/fat_core.c:86:9: warning: 'offset' may be used uninitialized in this function [-Wmaybe-uninitialized]
offset %= h->bytes_per_sector;
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:
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:
uint32 tmpoff = h->fat->first_data_sector % h->fat->sectors_per_cluster;
if (((sector % h->fat->sectors_per_cluster) - tmpoff) == 0) {
// .....
}
And I test above fix successfuly.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.