From 723b066423fa9c458c82e23d3daf364767fd77ff Mon Sep 17 00:00:00 2001 From: Antti Korpi Date: Sun, 22 Mar 2020 22:36:45 +0100 Subject: Only fflush on loop iterations that print Saves cycles. --- xkbcat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xkbcat.c b/xkbcat.c index b8c0109..0092317 100644 --- a/xkbcat.c +++ b/xkbcat.c @@ -94,10 +94,10 @@ int main(int argc, char * argv[]) { if (printKeyUps) printf("%s", cookie->evtype == XI_RawKeyPress ? "+" : "-"); printf("%s\n", str); + fflush(stdout); break; } } } - fflush(stdout); } } -- cgit v1.3-2-g0d8e