Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site watmath.UUCP Path: utzoo!watmath!wjafyfe From: wjafyfe@watmath.UUCP (Andy Fyfe) Newsgroups: net.lang.c Subject: Re: casts to (void) Message-ID: <16080@watmath.UUCP> Date: Tue, 6-Aug-85 17:41:25 EDT Article-I.D.: watmath.16080 Posted: Tue Aug 6 17:41:25 1985 Date-Received: Wed, 7-Aug-85 23:33:15 EDT References: <11@brl-tgr.ARPA> <1288@eagle.UUCP> <15908@watmath.UUCP> <116@rtp47.UUCP> <1096@diku.UUCP> <413@brl-tgr.ARPA> <498@h-sc1.UUCP> Reply-To: wjafyfe@watmath.UUCP (Andy Fyfe) Organization: U of Waterloo, Ontario Lines: 17 Summary: > The printf() function CAN FAIL and if you don't test for it, > Murphy says that it WILL fail, under the worst possible > circumstances (e.g., while updating YOUR pay record). /usr/lib/news/expire uses fprintf to re-write the active file. It didn't take the time to check the return value, and happened to run one night when /usr was full. Result -- a 0 length active file and a great deal of unhappy news software. printf (and fprintf) DO FAIL! (Since someone asked, printf and fprintf return EOF if they fail. (This is documented in our "UW Modified" man page). And don't forget to check fclose, since output may not actually be written until the file is closed. And don't let exit do the fclose's for you (since it doesn't check for errors)!) --Andy Fyfe ...!{decvax, allegra, ihnp4, et. al}!watmath!wjafyfe wjafyfe@waterloo.csnet