diff options
Diffstat (limited to 'fatfs')
-rw-r--r-- | fatfs/fat.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/fatfs/fat.c b/fatfs/fat.c index e191cfc4..f31ce115 100644 --- a/fatfs/fat.c +++ b/fatfs/fat.c @@ -69,11 +69,10 @@ void fat_read_sblock (void) { error_t err; - size_t read; + size_t read = sizeof(struct boot_sector); - sblock = malloc (sizeof (struct boot_sector)); - err = store_read (store, 0, sizeof (struct boot_sector), - (void **) &sblock, &read); + sblock = malloc (read); + err = store_read (store, 0, read, (void **) &sblock, &read); if (err) error (1, err, "Could not read superblock"); |