fix(color): Bitmap name truncation if exactly 14 characters long (#4232)

Co-authored-by: Peter Feerick <peter.feerick@gmail.com>
This commit is contained in:
philmoz
2023-10-31 11:40:49 +10:00
committed by GitHub
co-authored by Peter Feerick
parent ba30278456
commit f5593c44e8
7 changed files with 21 additions and 22 deletions
@@ -170,8 +170,8 @@ void onSdManagerMenu(const char * result)
}
#if LCD_DEPTH > 1
else if (result == STR_ASSIGN_BITMAP) {
strAppendFilename(g_model.header.bitmap, line, sizeof(g_model.header.bitmap));
memcpy(modelHeaders[g_eeGeneral.currModel].bitmap, g_model.header.bitmap, sizeof(g_model.header.bitmap));
strAppendFilename(g_model.header.bitmap, line, LEN_BITMAP_NAME);
memcpy(modelHeaders[g_eeGeneral.currModel].bitmap, g_model.header.bitmap, LEN_BITMAP_NAME);
storageDirty(EE_MODEL);
}
#endif
@@ -363,7 +363,7 @@ void menuRadioSdManager(event_t _event)
}
#if LCD_DEPTH > 1
else if (isExtensionMatching(ext, BITMAPS_EXT)) {
if (!READ_ONLY() && (ext-line) <= (int)sizeof(g_model.header.bitmap)) {
if (!READ_ONLY() && (ext-line) <= LEN_BITMAP_NAME) {
POPUP_MENU_ADD_ITEM(STR_ASSIGN_BITMAP);
}
}