Quellcode durchsuchen

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

Marcio Teixeira vor 7 Jahren
Ursprung
Commit
02a711c4d6
1 geänderte Dateien mit 1 neuen und 2 gelöschten Zeilen
  1. 1
    2
      Marlin/src/gcode/gcode.cpp

+ 1
- 2
Marlin/src/gcode/gcode.cpp Datei anzeigen

701
    */
701
    */
702
   void GcodeSuite::process_subcommands_now_P(const char *pgcode) {
702
   void GcodeSuite::process_subcommands_now_P(const char *pgcode) {
703
     // Save the parser state
703
     // Save the parser state
704
-    char saved_cmd[strlen(parser.command_ptr) + 1];
705
-    strcpy(saved_cmd, parser.command_ptr);
704
+    const char * const saved_cmd = parser.command_ptr;
706
 
705
 
707
     // Process individual commands in string
706
     // Process individual commands in string
708
     while (pgm_read_byte_near(pgcode)) {
707
     while (pgm_read_byte_near(pgcode)) {

Laden…
Abbrechen
Speichern