Remake the CLI tool #4
@@ -145,6 +145,7 @@ static char* read_stdin() {
|
||||
static int read_prompt(char* buf, int buf_size, char* prompt, const int required) {
|
||||
do {
|
||||
printf("%s", prompt);
|
||||
fflush(stdout);
|
||||
if (!fgets(buf, buf_size, stdin)) return 1;
|
||||
const size_t len = noom_strlen(buf);
|
||||
if (len > 0 && buf[len - 1] != '\n') {
|
||||
|
||||
Reference in New Issue
Block a user