From 6aec307fcced3dbd5dc47c52c79bd5c833021f51 Mon Sep 17 00:00:00 2001 From: Ralph Corderoy Date: Sun, 13 Aug 2017 18:07:33 +0100 Subject: [PATCH] inc.c: Alter pop_action() to check I/O, perhaps returning NOTOK. --- uip/inc.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/uip/inc.c b/uip/inc.c index 9a72aa45..20d4088b 100644 --- a/uip/inc.c +++ b/uip/inc.c @@ -918,7 +918,11 @@ static int pop_action(void *closure, char *s) { NMH_UNUSED(closure); - fprintf (pf, "%s\n", s); - stop += strlen (s) + 1; + + if (fputs(s, pf) == EOF || putc('\n', pf) == EOF) + return NOTOK; + + stop += strlen(s) + 1; /* Count linefeed too. */ + return OK; } -- 2.56.0