forked from M-Labs/rust-fatfs
Dont panic on unknown file attributes.
This commit is contained in:
parent
d32ae0eef9
commit
f850c76a1b
@ -294,8 +294,8 @@ pub struct DirIter<'a, 'b: 'a> {
|
||||
impl <'a, 'b> DirIter<'a, 'b> {
|
||||
fn read_dir_entry_data(&mut self) -> io::Result<DirEntryData> {
|
||||
let mut name = [0; 11];
|
||||
self.rdr.read(&mut name)?;
|
||||
let attrs = FileAttributes::from_bits(self.rdr.read_u8()?).expect("invalid attributes"); // FIXME
|
||||
self.rdr.read_exact(&mut name)?;
|
||||
let attrs = FileAttributes::from_bits_truncate(self.rdr.read_u8()?);
|
||||
if attrs == FileAttributes::LFN {
|
||||
let mut data = DirLfnEntryData {
|
||||
attrs, ..Default::default()
|
||||
|
Loading…
Reference in New Issue
Block a user