Skip to content

Commit 9500b21

Browse files
peffgitster
authored andcommitted
remote: return non-const pointer from error_buf()
We have an error_buf() helper that functions a bit like our error() helper, but returns NULL instead of -1. Its return type is "const char *", but this is overly restrictive. If we use the helper in a function that returns non-const "char *", the compiler will complain about the implicit cast from const to non-const. Meanwhile, the const in the helper is doing nothing useful, as it only ever returns NULL. Let's drop the const, which will let us use it in both types of function. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 9a2fb14 commit 9500b21

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

remote.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1838,7 +1838,7 @@ int branch_merge_matches(struct branch *branch,
18381838
}
18391839

18401840
__attribute__((format (printf,2,3)))
1841-
static const char *error_buf(struct strbuf *err, const char *fmt, ...)
1841+
static char *error_buf(struct strbuf *err, const char *fmt, ...)
18421842
{
18431843
if (err) {
18441844
va_list ap;

0 commit comments

Comments
 (0)