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

This commit is contained in:
Marcio Teixeira 2018-04-24 12:44:22 -06:00 committed by Scott Lahteine
parent a3ce8a3fcd
commit 02a711c4d6

View file

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