diff options
author | Thomas Osterried <thomas@osterried.de> | 2008-11-24 23:12:20 +0000 |
---|---|---|
committer | Thomas Osterried <thomas@osterried.de> | 2008-11-24 23:12:20 +0000 |
commit | 885896de6a658fdae7d3802684cb9b809b10a86f (patch) | |
tree | d43518d2c296b571907be174bf6e715db27ca3a4 /listen/utils.c | |
parent | a85aedc86cd3319824435ebba864587117474418 (diff) |
listen did not terminate if caller has died. fputs and fflush
return value EOF was not honored.
Diffstat (limited to 'listen/utils.c')
-rw-r--r-- | listen/utils.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/listen/utils.c b/listen/utils.c index e6f7244..52b4f0a 100644 --- a/listen/utils.c +++ b/listen/utils.c @@ -71,8 +71,10 @@ void lprintf(int dtype, char *fmt, ...) if ((*p < 32 && *p != '\n') || (*p > 126 && *p < 160 && sevenbit)) *p = '.'; - fputs(str, stdout); - fflush(stdout); + if (fputs(str, stdout) == -1) + exit(1); + if (fflush(stdout) == -1) + exit(1); } } |