Skip to content

Commit 8831657

Browse files
committed
Use MAX_LONG_NAME_LEN constant in validate_long_name function
1 parent c8bc2af commit 8831657

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/dir.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ fn validate_long_name<E: IoError>(name: &str) -> Result<(), Error<E>> {
702702
if name.is_empty() {
703703
return Err(Error::InvalidFileNameLength);
704704
}
705-
if name.len() > 255 {
705+
if name.len() > MAX_LONG_NAME_LEN {
706706
return Err(Error::InvalidFileNameLength);
707707
}
708708
// check if there are only valid characters
@@ -732,7 +732,6 @@ pub(crate) struct LfnBuffer {
732732
ucs2_units: Vec<u16>,
733733
}
734734

735-
#[cfg(feature = "lfn")]
736735
const MAX_LONG_NAME_LEN: usize = 255;
737736

738737
#[cfg(feature = "lfn")]

0 commit comments

Comments
 (0)