Merge pull request #513 from DrDoof/fix/port-name-no-arg

cmd: "port <n> name" without a name clears it instead of reading stale words
This commit is contained in:
René van Dorst authored and GitHub committed 2026-09-23 18:21:14 +00:00
commit 4bbbcd7d04
1 file changed
+1 -1
+1 -1
View File
@@ -901,7 +901,7 @@ void parse_port(void)
port_media_show(phy_settings.port);
} else if (cmd_compare(2, "name")) {
uint8_t i = 0;
while ( (i < PORT_NAME_SIZE-1) && (cmd_buffer[cmd_words_b[3] + i] != NUL) ) {
while ( cmd_words_len > 3 && (i < PORT_NAME_SIZE-1) && (cmd_buffer[cmd_words_b[3] + i] != NUL) ) {
port_names[phy_settings.port][i] = name_char(cmd_buffer[cmd_words_b[3] + i]);
i++;
}