Yes you are right. But if you use this function for binary data it
doesn't work. Function fwrite enters into for loop and stays there
until putc returns zero or all data have been written. If data contain
zero values the fwrite will exit on first zero value.
Marjan Fojkar <address@hidden> wrote:
I expected that if one byte is successfully written then the
function returns 1 if byte is not written then it returns 0.
This is how it works.
In case of error it returns e.g. EOF.
No, it returns a `short write count' (less than requested), i.e. it
could only be zero in your case since you only request one object.
This is exactly how the C standard requires it.
Of course, this all depends whether your backend put() function can
actually return an error indication.