fwrite return the number of elements (3rd parameter, here always 1) written,
at least 0 (return value is size_t and unsigned). In success case we have
here always an return value of 1, in fail case an return value of 0.
Please apply attached patch
Created attachment 10963 [details] [review]
adjusts the checks...
Fix pushed. Thanks!
*** Bug 12487 has been marked as a duplicate of this bug. ***