Function fputs always return zero on success
Although your observations show that you happen to always get 0 as a (success-case) return value, implementations are permitted to return any value of 0 or more.  For example, a different implementation of the standard library may find it convenient to return the number of characters that have been printed.

You cannot assume that rets == 0 will be as good as rets &gt;= 0, because:


You might want to run your code on a different system, with a different standard library.  This might happen if you share your code with somebody else (perhaps for them to help you fix a bug).
The different system might be your current system in a year's time, when you've upgraded your libraries.


If your assumption is no longer true, then you suddenly have a huge number of hard-to-find bugs that all need fixing at once.  That is not what we call a Good Thing.  By depending only on what the standard guarantees, you maximise your likelihood of full portability, including to future versions of your current environment.