Remake the CLI tool #4

Merged
Blendi merged 2 commits from :main into main 2026-05-26 18:37:01 +02:00
Showing only changes of commit a3e2d78d3a - Show all commits

View File

@@ -145,6 +145,7 @@ static char* read_stdin() {
static int read_prompt(char* buf, int buf_size, char* prompt, const int required) { static int read_prompt(char* buf, int buf_size, char* prompt, const int required) {
do { do {
printf("%s", prompt); printf("%s", prompt);
fflush(stdout);
if (!fgets(buf, buf_size, stdin)) return 1; if (!fgets(buf, buf_size, stdin)) return 1;
const size_t len = noom_strlen(buf); const size_t len = noom_strlen(buf);
if (len > 0 && buf[len - 1] != '\n') { if (len > 0 && buf[len - 1] != '\n') {