From c6c60d018e1475c8c53bbdcad4540781f2e4dae6 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 28 Jan 2017 00:06:03 -0500 Subject: [PATCH] Added some fflush after the printf with no \n so we don't have a blank screen when compiled with musl. --- src/toxic.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/toxic.c b/src/toxic.c index 0c7b7b7..358e45d 100644 --- a/src/toxic.c +++ b/src/toxic.c @@ -382,6 +382,7 @@ static void first_time_encrypt(const char *msg) do { system("clear"); printf("%s ", msg); + fflush(stdout); if (!strcasecmp(ch, "y\n") || !strcasecmp(ch, "n\n") || !strcasecmp(ch, "yes\n") || !strcasecmp(ch, "no\n") || !strcasecmp(ch, "q\n")) @@ -402,6 +403,7 @@ static void first_time_encrypt(const char *msg) printf("Enter a new password (must be at least %d characters) ", MIN_PASSWORD_LEN); while (valid_password == false) { + fflush(stdout); // Flush all before user input len = password_prompt(user_password.pass, sizeof(user_password.pass)); user_password.len = len; @@ -627,6 +629,7 @@ static Tox *load_tox(char *data_path, struct Tox_Options *tox_opts, TOX_ERR_NEW char plain[plain_len]; while (true) { + fflush(stdout); // Flush before prompts so the user sees the question/message if (pweval) { pwlen = password_eval(user_password.pass, sizeof(user_password.pass)); } else {