branch: use write_file_buf instead of write_file
[gitweb.git] / builtin / branch.c
index 15232c4a428b5b458fcd974440b0e884c2db6952..1d41251a9a86a2533b550842b0c9500e61265492 100644 (file)
@@ -618,7 +618,7 @@ static int edit_branch_description(const char *branch_name)
                    "  %s\n"
                    "Lines starting with '%c' will be stripped.\n",
                    branch_name, comment_line_char);
-       write_file(git_path(edit_description), "%s", buf.buf);
+       write_file_buf(git_path(edit_description), buf.buf, buf.len);
        strbuf_reset(&buf);
        if (launch_editor(git_path(edit_description), &buf, NULL)) {
                strbuf_release(&buf);