From 0c8cc09aea17ecb1220818fb453558f900380d47 Mon Sep 17 00:00:00 2001 From: midipix Date: Sat, 4 Nov 2017 16:18:14 -0400 Subject: amgc_stdin_to_tmp(): call fflush() upon return. --- src/driver/amgc_unit_ctx.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/driver/amgc_unit_ctx.c b/src/driver/amgc_unit_ctx.c index 40f4257..17568d2 100644 --- a/src/driver/amgc_unit_ctx.c +++ b/src/driver/amgc_unit_ctx.c @@ -4,6 +4,7 @@ /* Released under GPLv2 and GPLv3; see COPYING.APIMAGIC. */ /**********************************************************/ +#include #include #include #include @@ -82,6 +83,11 @@ static FILE * amgc_stdin_to_tmp(const struct amgc_driver_ctx * dctx) nread = read(0,buf,sizeof(buf)-1); } + if (fflush(ftmp)) { + fclose(ftmp); + return 0; + } + return ftmp; } -- cgit v1.2.3