Browse Source

[2.0.x] Fix crash upon repeated calls to process_subcommands_now_P (#10509)

pull/1/head
Marcio Teixeira 7 years ago
committed by Scott Lahteine
parent
commit
02a711c4d6
  1. 3
      Marlin/src/gcode/gcode.cpp

3
Marlin/src/gcode/gcode.cpp

@ -701,8 +701,7 @@ void GcodeSuite::process_next_command() {
*/ */
void GcodeSuite::process_subcommands_now_P(const char *pgcode) { void GcodeSuite::process_subcommands_now_P(const char *pgcode) {
// Save the parser state // Save the parser state
char saved_cmd[strlen(parser.command_ptr) + 1]; const char * const saved_cmd = parser.command_ptr;
strcpy(saved_cmd, parser.command_ptr);
// Process individual commands in string // Process individual commands in string
while (pgm_read_byte_near(pgcode)) { while (pgm_read_byte_near(pgcode)) {

Loading…
Cancel
Save