add fflush

This commit is contained in:
tema5002
2026-05-26 19:26:52 +03:00
parent bce297dbb3
commit a3e2d78d3a

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') {