From 2f5ac730c99207d8c8c0604a0201d8d8aea30a33 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Sun, 7 Dec 2014 14:29:24 +0000 Subject: [PATCH] ssh: fflush the shell prompt From: Will Sowerbutts The assumption that libc will fflush stdout on an fgets of stdin is not anything the standards guarantee. Do the needed fflush --- Applications/util/ssh.c | 1 + 1 file changed, 1 insertion(+) diff --git a/Applications/util/ssh.c b/Applications/util/ssh.c index 6399ac7f..aad10086 100644 --- a/Applications/util/ssh.c +++ b/Applications/util/ssh.c @@ -51,6 +51,7 @@ main(int argc, char *argval[]) for (i = 0; i < MAX_ARGS; i++) arg[i][0] = (char) 0; do { printf("ssh%c ", cprompt); + fflush(stdout); fgets(buf, 127, stdin); if (feof(stdin)) return 0; /* user typed ^D ? */ buf[strlen(buf) - 1] = '\0'; /* Strip newline from fgets */ -- 2.34.1