aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--Makefile2
-rw-r--r--src/passphrase.c6
2 files changed, 5 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index bd9b847..b20e0a0 100644
--- a/Makefile
+++ b/Makefile
@@ -9,7 +9,7 @@ OPTIONS =
OPTIMISE = -Os
CPPFLAGS = $(foreach D, $(OPTIONS), -D'$(D)=1')
-CFLAGS = -std=c99 -Wall -Wextra -fPIC
+CFLAGS = -std=gnu99 -Wall -Wextra -fPIC
LDFLAGS = -shared
CC_FLAGS = $(CPPFLAGS) $(CFLAGS) $(OPTIMISE)
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;
}