From 0c8cc09aea17ecb1220818fb453558f900380d47 Mon Sep 17 00:00:00 2001 From: midipix Date: Nov 04 2017 20:18:14 +0000 Subject: amgc_stdin_to_tmp(): call fflush() upon return. --- 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; }