parse_ee() make use of cmd_words_len

This commit is contained in:
René van Dorst
2026-04-18 19:35:51 +02:00
parent a24b63a81f
commit f2ff7d7737
+2 -2
View File
@@ -1059,7 +1059,7 @@ void parse_eee(void)
__xdata uint8_t speed = EEE_2G5; __xdata uint8_t speed = EEE_2G5;
__xdata uint8_t speed_word = 0; __xdata uint8_t speed_word = 0;
// Check if word 2 is a speed (contains 'g' or 'm') or a port number // Check if word 2 is a speed (contains 'g' or 'm') or a port number
if (cmd_words_b[3] > 0) { if (cmd_words_len >= 3) {
uint8_t idx = cmd_words_b[2]; uint8_t idx = cmd_words_b[2];
// Skip digits to check if there's a letter after // Skip digits to check if there's a letter after
while (isnumber(cmd_buffer[idx])) while (isnumber(cmd_buffer[idx]))
@@ -1072,7 +1072,7 @@ void parse_eee(void)
port = cmd_buffer[cmd_words_b[2]] - '1'; port = cmd_buffer[cmd_words_b[2]] - '1';
port = machine.phys_to_log_port[port]; port = machine.phys_to_log_port[port];
// Check if word 3 is a speed // Check if word 3 is a speed
if (cmd_words_b[4] > 0) if (cmd_words_len >= 4)
speed_word = 3; speed_word = 3;
} }
} }