♻️ String helper class (#24390)
This commit is contained in:
parent
4a734e4de4
commit
574dd34c49
36 changed files with 955 additions and 598 deletions
|
|
@ -1173,10 +1173,7 @@ void GcodeSuite::process_subcommands_now(FSTR_P fgcode) {
|
|||
for (;;) {
|
||||
PGM_P const delim = strchr_P(pgcode, '\n'); // Get address of next newline
|
||||
const size_t len = delim ? delim - pgcode : strlen_P(pgcode); // Get the command length
|
||||
char cmd[len + 1]; // Allocate a stack buffer
|
||||
strncpy_P(cmd, pgcode, len); // Copy the command to the stack
|
||||
cmd[len] = '\0'; // End with a nul
|
||||
parser.parse(cmd); // Parse the command
|
||||
parser.parse(MString<MAX_CMD_SIZE>().setn_P(pgcode, len)); // Parse the command
|
||||
process_parsed_command(true); // Process it (no "ok")
|
||||
if (!delim) break; // Last command?
|
||||
pgcode = delim + 1; // Get the next command
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue