Per the man:
> puts() and fputs() return a nonnegative number on success, or EOF on error.
r is the result of the write, if it’s nonzero the write failed and thus so did puts.
> puts() and fputs() return a nonnegative number on success, or EOF on error.
r is the result of the write, if it’s nonzero the write failed and thus so did puts.