From bb434b5c6e211cb051fe8b1678d35e279f6b133c Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 23 Nov 2013 19:36:05 +0100 Subject: m MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/passphrase.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/passphrase.c b/src/passphrase.c index 8329d25..8ff4c56 100644 --- a/src/passphrase.c +++ b/src/passphrase.c @@ -57,6 +57,9 @@ static inline char* xrealloc(char* array, size_t size) #endif +#define xprintf(...) ({ printf(__VA_ARGS__); fflush(stdout); }) + + /** * Reads the passphrase from stdin * @@ -87,8 +90,7 @@ char* passphrase_read(void) { if (len == 0) continue; - printf("\033[D \033[D"); - fflush(stdout); + xprintf("\033[D \033[D"); *(rc + --len) = 0; continue; } -- cgit v1.2.3-70-g09d2