From 9fdbba862dfa53cf347fd9f05e99bd1f13c5eb0c Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Wed, 6 Aug 2025 07:54:16 +0200 Subject: ident: fix type of string length parameter The last parameter in `split_ident_line()` is the length of the line passed in by the caller. As such, most callers pass in either the result of `strlen()`, `struct strbuf::len` or a pointer diff, all of which are expected to be positive numbers. Regardless of that, the function accepts a signed integer, which is somewhat confusing. Fix the function signature to instead accept a `size_t`. Signed-off-by: Patrick Steinhardt Signed-off-by: Junio C Hamano --- ident.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ident.h') diff --git a/ident.h b/ident.h index 6a79febba1..3c03403879 100644 --- a/ident.h +++ b/ident.h @@ -35,7 +35,7 @@ void reset_ident_date(void); * Signals an success with 0, but time part of the result may be NULL * if the input lacks timestamp and zone */ -int split_ident_line(struct ident_split *, const char *, int); +int split_ident_line(struct ident_split *, const char *, size_t); /* * Given a commit or tag object buffer and the commit or tag headers, replaces -- cgit v1.2.3