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>
Jeff King committed
Jan 19, 2026 at 00:19 UTC
9500b2131d29960d3fbd35559c063f7a74568875
1 file changed
+1
-1
remote.c
+1
-1
@@ -1838,7 +1838,7 @@ int branch_merge_matches(struct branch *branch,
1838
}
1839
1840
__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, ...)
1842
{
1843
if (err) {
1844
va_list ap;