diff options
author | Trumeet <yuuta@yuuta.moe> | 2021-10-11 13:39:51 -0700 |
---|---|---|
committer | Trumeet <yuuta@yuuta.moe> | 2021-10-11 13:39:51 -0700 |
commit | c090d474649fad9873e7e7231879d070ab062fc6 (patch) | |
tree | c875538bfad60cf1a598db7fdc45f1fe70249d5d | |
parent | 8e1fcfd0dd7dc8fa9f5450253d12e89dfafdd855 (diff) | |
download | easy-tg-c090d474649fad9873e7e7231879d070ab062fc6.tar easy-tg-c090d474649fad9873e7e7231879d070ab062fc6.tar.gz easy-tg-c090d474649fad9873e7e7231879d070ab062fc6.tar.bz2 easy-tg-c090d474649fad9873e7e7231879d070ab062fc6.zip |
flush stdout after printing the prompt
-rw-r--r-- | example.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -11,6 +11,7 @@ static void read_input(const char *prompt, char *buf, unsigned int len) { printf("%s", prompt); + fflush(stdout); ssize_t size = read(0, buf, len + 1); if(size >= 1) buf[size - 1] = '\0'; printf("Read: %s\n", buf); |