Fix misuse of const char pointer by creating a new string which represents the filename.

This commit is contained in:
Knutwurst
2023-05-30 15:09:46 +02:00
parent ad86d96a31
commit e0d858d812

View File

@@ -980,7 +980,7 @@ void AnycubicTouchscreenClass::RenderCurrentFolder(uint16_t selectedNumber) {
*/
// The longname may not be filed, so we use the built-in fallback here.
const char* fileName = currentFileList.filename();
char* fileName = strdup(currentFileList.filename());
int fileNameLen = strlen(fileName);
bool fileNameWasCut = false;