Thread (155 messages) 155 messages, 8 authors, 2018-09-27

Re: [GSoC][PATCH v5 02/20] rebase -i: rewrite append_todo_help() in C

From: Christian Couder <hidden>
Date: 2018-08-07 15:25:05

Hi Phillip,

On Tue, Aug 7, 2018 at 3:57 PM, Phillip Wood [off-list ref] wrote:
On 31/07/18 18:59, Alban Gruin wrote:
quoted
+
+     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)
quoted
+     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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help