From e0d858d812af013585f5f9f098d3018795c7e739 Mon Sep 17 00:00:00 2001 From: Knutwurst <36196269+knutwurst@users.noreply.github.com> Date: Tue, 30 May 2023 15:09:46 +0200 Subject: [PATCH] Fix misuse of const char pointer by creating a new string which represents the filename. --- Marlin/src/lcd/extui/knutwurst/anycubic_touchscreen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/lcd/extui/knutwurst/anycubic_touchscreen.cpp b/Marlin/src/lcd/extui/knutwurst/anycubic_touchscreen.cpp index fbc3e0f6..9a642319 100755 --- a/Marlin/src/lcd/extui/knutwurst/anycubic_touchscreen.cpp +++ b/Marlin/src/lcd/extui/knutwurst/anycubic_touchscreen.cpp @@ -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;