I think fwrite returns '0' if record size is '0'.