Skip to content

Commit fee85b3

Browse files
authored
✏️ Fix getLFNName parameter (MarlinFirmware#23752)
1 parent cba8d4f commit fee85b3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Marlin/src/sd/SdBaseFile.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1140,8 +1140,8 @@ bool SdBaseFile::openNext(SdBaseFile *dirFile, uint8_t oflag) {
11401140
// We can't reconvert to UTF-8 here as UTF-8 is variable-size encoding, but joining LFN blocks
11411141
// needs static bytes addressing. So here just store full UTF-16LE words to re-convert later.
11421142
uint16_t idx = (startOffset + i) * 2; // This is fixed as FAT LFN always contain UTF-16LE encoding
1143-
longFilename[idx] = utf16_ch & 0xFF;
1144-
longFilename[idx + 1] = (utf16_ch >> 8) & 0xFF;
1143+
lname[idx] = utf16_ch & 0xFF;
1144+
lname[idx + 1] = (utf16_ch >> 8) & 0xFF;
11451145
#else
11461146
// Replace all multibyte characters to '_'
11471147
lname[startOffset + i] = (utf16_ch > 0xFF) ? '_' : (utf16_ch & 0xFF);

0 commit comments

Comments
 (0)