Skip to content

Commit f96afaa

Browse files
MathiasKochrafalh
authored andcommitted
Correctly set and use self.len in LfnBuffer, when alloc feature is disabled
1 parent 48d428d commit f96afaa

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/dir.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -789,6 +789,7 @@ impl LfnBuffer {
789789
};
790790
for (i, usc2_unit) in usc2_units.enumerate() {
791791
lfn.ucs2_units[i] = usc2_unit;
792+
lfn.len += 1;
792793
}
793794
lfn
794795
}
@@ -807,7 +808,7 @@ impl LfnBuffer {
807808
}
808809

809810
pub(crate) fn as_ucs2_units(&self) -> &[u16] {
810-
&self.ucs2_units
811+
&self.ucs2_units[..self.len]
811812
}
812813
}
813814

0 commit comments

Comments
 (0)