diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 0bfba2c83..3afaf1b2e 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -5307,8 +5307,8 @@ void process_next_command() { // - Bypass N[0-9][0-9]*[ ]* // - Overwrite * with nul to mark the end while (*current_command == ' ') ++current_command; - if (*current_command == 'N' && current_command[1] >= '0' && current_command[1] <= '9') { - current_command += 2; // skip N[0-9] + if (*current_command == 'N' && ((current_command[1] >= '0' && current_command[1] <= '9') || current_command[1] == '-')) { + current_command += 2; // skip N[-0-9] while (*current_command >= '0' && *current_command <= '9') ++current_command; // skip [0-9]* while (*current_command == ' ') ++current_command; // skip [ ]* }