Browse Source

Fix 'cmd' array warning (#19193)

ellensp 3 years ago
parent
commit
2a72961be4
No account linked to committer's email address
1 changed files with 3 additions and 2 deletions
  1. 3
    2
      Marlin/src/lcd/menu/menu_filament.cpp

+ 3
- 2
Marlin/src/lcd/menu/menu_filament.cpp View File

@@ -138,8 +138,9 @@ void _menu_temp_filament_op(const PauseMode mode, const int8_t extruder) {
138 138
           SUBMENU_N_P(s, msg, []{ _menu_temp_filament_op(PAUSE_MODE_CHANGE_FILAMENT, MenuItemBase::itemIndex); });
139 139
         else {
140 140
           ACTION_ITEM_N_P(s, msg, []{
141
-            char cmd[13];
142
-            sprintf_P(cmd, PSTR("M600 B0 T%i"), int(MenuItemBase::itemIndex));
141
+            PGM_P const cmdpstr = PSTR("M600 B0 T%i");
142
+            char cmd[strlen_P(cmdpstr) + 3 + 1];
143
+            sprintf_P(cmd, cmdpstr, int(MenuItemBase::itemIndex));
143 144
             queue.inject(cmd);
144 145
           });
145 146
         }

Loading…
Cancel
Save