Skip to content
This repository was archived by the owner on Feb 4, 2024. It is now read-only.

Commit 084d055

Browse files
wsakernellarsks
authored andcommitted
really put baud rate changes to history
Write the contents before we free the memory again. Signed-off-by: Wolfram Sang <[email protected]>
1 parent a548fcb commit 084d055

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

picocom.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -609,13 +609,12 @@ read_baud (void)
609609
if ( ! ep || *ep != '\0' || ! term_baud_ok(baud) || baud == 0 ) {
610610
fd_printf(STO, "*** Invalid baudrate!");
611611
baud = -1;
612+
} else {
613+
add_history(baudstr);
612614
}
613615
free(baudstr);
614616
} while (baud < 0);
615617

616-
if (baudstr != NULL)
617-
add_history(baudstr);
618-
619618
return baud;
620619
}
621620

0 commit comments

Comments
 (0)