mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2025-06-26 08:50:34 +00:00
Wrap macros to prevent bad expansions
This commit is contained in:
parent
7bb7ac8353
commit
f9ded2a7c4
32 changed files with 158 additions and 158 deletions
Marlin
|
@ -1134,7 +1134,7 @@ int8_t SdBaseFile::readDir(dir_t* dir, char* longFilename) {
|
|||
// Sanity-check the VFAT entry. The first cluster is always set to zero. And the sequence number should be higher than 0
|
||||
if (VFAT->firstClusterLow == 0 && (VFAT->sequenceNumber & 0x1F) > 0 && (VFAT->sequenceNumber & 0x1F) <= MAX_VFAT_ENTRIES) {
|
||||
// TODO: Store the filename checksum to verify if a none-long filename aware system modified the file table.
|
||||
n = ((VFAT->sequenceNumber & 0x1F) - 1) * FILENAME_LENGTH;
|
||||
n = ((VFAT->sequenceNumber & 0x1F) - 1) * (FILENAME_LENGTH);
|
||||
for (uint8_t i = 0; i < FILENAME_LENGTH; i++)
|
||||
longFilename[n + i] = (i < 5) ? VFAT->name1[i] : (i < 11) ? VFAT->name2[i - 5] : VFAT->name3[i - 11];
|
||||
// If this VFAT entry is the last one, add a NUL terminator at the end of the string
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue