From 91e4c0923894d7b28039de8d58b9d7d09677ff36 Mon Sep 17 00:00:00 2001 From: Zhang Huanjie Date: Mon, 13 Jun 2016 00:55:08 +0000 Subject: [PATCH] fflush error in raw mode exit --- mode_s.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mode_s.c b/mode_s.c index cd129a02b..0da0ec308 100644 --- a/mode_s.c +++ b/mode_s.c @@ -1166,8 +1166,10 @@ void displayModesMessage(struct modesMessage *mm) { printf(";\n"); if (Modes.raw) { - fflush(stdout); // Provide data to the reader ASAP - return; // Enough for --raw mode + if(fflush(stdout) == 0) // Provide data to the reader ASAP + return; // Enough for --raw mode + else + exit(1); // fflush error should exit } if (mm->msgtype < 32)