diff --git a/Marlin/SdBaseFile.cpp b/Marlin/SdBaseFile.cpp index 472a60a56a01..4927ab2e2797 100644 --- a/Marlin/SdBaseFile.cpp +++ b/Marlin/SdBaseFile.cpp @@ -405,7 +405,7 @@ bool SdBaseFile::make83Name(const char* str, uint8_t* name, const char** ptr) { uint8_t b; while ((b = pgm_read_byte(p++))) if (b == c) goto fail; // check size and only allow ASCII printable characters - if (i > n || c < 0X21 || c > 0X7E)goto fail; + if (i > n || c < 0X21 || c == 0X7E)goto fail; // only upper case allowed in 8.3 names - convert lower to upper name[i++] = (c < 'a' || c > 'z') ? (c) : (c + ('A' - 'a')); }