Giter VIP home page Giter VIP logo

openfat's People

Contributors

drluke avatar gsmcmullin avatar tmolteno avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

openfat's Issues

found a bug in function fat_read and give a fix

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:

if((sector % h->fat->sectors_per_cluster) == 0) {

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.