aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2013-11-23 19:36:05 +0100
committerMattias Andrée <maandree@operamail.com>2013-11-23 19:36:05 +0100
commitbb434b5c6e211cb051fe8b1678d35e279f6b133c (patch)
treeac4060bc5a74a13873b168ae3b4095f2fbc0aee8 /src
parentdefine xrealloc as a secure realloc (diff)
downloadlibpassphrase-bb434b5c6e211cb051fe8b1678d35e279f6b133c.tar.gz
libpassphrase-bb434b5c6e211cb051fe8b1678d35e279f6b133c.tar.bz2
libpassphrase-bb434b5c6e211cb051fe8b1678d35e279f6b133c.tar.xz
m
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src')
-rw-r--r--src/passphrase.c6
1 files changed, 4 insertions, 2 deletions
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;
}