Simplify non-printable char filter loop.
This commit is contained in:
@@ -990,10 +990,11 @@ void AnycubicTouchscreenClass::RenderCurrentFolder(uint16_t selectedNumber) {
|
|||||||
// Bugfix for non-printable special characters
|
// Bugfix for non-printable special characters
|
||||||
// which are now replaced by underscores.
|
// which are now replaced by underscores.
|
||||||
for (unsigned char i = 0; i <= fileNameLen; i++) {
|
for (unsigned char i = 0; i <= fileNameLen; i++) {
|
||||||
|
if (isPrintable(fileName[i])) {
|
||||||
outputString[i] = fileName[i];
|
outputString[i] = fileName[i];
|
||||||
if (!isPrintable(outputString[i])) {
|
} else {
|
||||||
outputString[i] = '_';
|
outputString[i] = '_';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// I know, it's ugly, but it's faster than a string lib
|
// I know, it's ugly, but it's faster than a string lib
|
||||||
|
Reference in New Issue
Block a user