From fda51c1c467a565c5a4bd1cfd05eb53c9718d5db Mon Sep 17 00:00:00 2001 From: Knutwurst <36196269+knutwurst@users.noreply.github.com> Date: Thu, 1 Jun 2023 17:13:17 +0200 Subject: [PATCH] Remove unneccessary code in the filename check. --- Marlin/src/lcd/extui/knutwurst/anycubic_touchscreen.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Marlin/src/lcd/extui/knutwurst/anycubic_touchscreen.cpp b/Marlin/src/lcd/extui/knutwurst/anycubic_touchscreen.cpp index 65faa066..df8fef65 100755 --- a/Marlin/src/lcd/extui/knutwurst/anycubic_touchscreen.cpp +++ b/Marlin/src/lcd/extui/knutwurst/anycubic_touchscreen.cpp @@ -990,14 +990,10 @@ void AnycubicTouchscreenClass::RenderCurrentFolder(uint16_t selectedNumber) { // Bugfix for non-printable special characters // which are now replaced by underscores. for (unsigned char i = 0; i <= fileNameLen; i++) { - if (i >= fileNameLen) { - outputString[i] = ' '; - } - else { outputString[i] = fileName[i]; - if (!isPrintable(outputString[i])) + if (!isPrintable(outputString[i])) { outputString[i] = '_'; - } + } } // I know, it's ugly, but it's faster than a string lib