From 414136f33afc431642e189f574c12e8ec23d9e28 Mon Sep 17 00:00:00 2001 From: ellensp Date: Tue, 1 Sep 2020 08:05:42 +1200 Subject: [PATCH] Fix 'cmd' array warning (#19193) --- Marlin/src/lcd/menu/menu_filament.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Marlin/src/lcd/menu/menu_filament.cpp b/Marlin/src/lcd/menu/menu_filament.cpp index 316b2bc78..5d02d674a 100644 --- a/Marlin/src/lcd/menu/menu_filament.cpp +++ b/Marlin/src/lcd/menu/menu_filament.cpp @@ -138,8 +138,9 @@ void _menu_temp_filament_op(const PauseMode mode, const int8_t extruder) { SUBMENU_N_P(s, msg, []{ _menu_temp_filament_op(PAUSE_MODE_CHANGE_FILAMENT, MenuItemBase::itemIndex); }); else { ACTION_ITEM_N_P(s, msg, []{ - char cmd[13]; - sprintf_P(cmd, PSTR("M600 B0 T%i"), int(MenuItemBase::itemIndex)); + PGM_P const cmdpstr = PSTR("M600 B0 T%i"); + char cmd[strlen_P(cmdpstr) + 3 + 1]; + sprintf_P(cmd, cmdpstr, int(MenuItemBase::itemIndex)); queue.inject(cmd); }); }