The root directory cluster field only exists in a FAT32 boot sector, so the
'root_cluster' variable in do_fat_read() contains garbage in case of FAT12/16.
Make it contain 0 instead as this is what is passed to get_vfatname() in that
case anyway.
Signed-off-by: Sergei Shtylyov <sshtylyov@mvista.com>
int files = 0, dirs = 0;
long ret = -1;
int firsttime;
- __u32 root_cluster;
+ __u32 root_cluster = 0;
int rootdir_size = 0;
int j;
return -1;
}
- root_cluster = bs.root_cluster;
-
- if (mydata->fatsize == 32)
+ if (mydata->fatsize == 32) {
+ root_cluster = bs.root_cluster;
mydata->fatlength = bs.fat32_length;
- else
+ } else {
mydata->fatlength = bs.fat_length;
+ }
mydata->fat_sect = bs.reserved;
((dir_slot *)dentptr)->alias_checksum;
get_vfatname(mydata,
- (mydata->fatsize == 32) ?
- root_cluster :
- 0,
+ root_cluster,
do_fat_read_block,
dentptr, l_name);