[C] More error checking of fprintf.