Hi Phillip,

On Tue, Aug 7, 2018 at 3:57 PM, Phillip Wood <phillip.w...@talktalk.net> wrote:
>
> On 31/07/18 18:59, Alban Gruin wrote:
>>
>> +
>> +     ret = fputs(buf.buf, todo);
>
> It is not worth changing the patch just for this but strbuf_write()
> might be clearer (you use it in a later patch)
>
>> +     if (ret < 0)
>> +             error_errno(_("could not append help text to '%s'"), 
>> rebase_path_todo());
>> +
>> +     fclose(todo);
>
> You should definitely check the return value and return an error if
> appropriate as fputs() might not actually write any data until you try
> and close the file.

I agree about checking the return value from fputs(), but it seems to
me that we don't usually check the value of fclose().

Thanks,
Christian.

Reply via email to