diff options
| author | Patrick Steinhardt <ps@pks.im> | 2025-08-06 07:54:16 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-08-06 07:36:30 -0700 |
| commit | 9fdbba862dfa53cf347fd9f05e99bd1f13c5eb0c (patch) | |
| tree | bf2ed2179c6d5d123d1d30c3fd9feb37e6efea6e /ident.c | |
| parent | 7aa619c36f4d6ba5710f7273739655914e65d9c5 (diff) | |
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 <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'ident.c')
| -rw-r--r-- | ident.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -272,7 +272,7 @@ static void strbuf_addstr_without_crud(struct strbuf *sb, const char *src) * can still be NULL if the input line only has the name/email part * (e.g. reading from a reflog entry). */ -int split_ident_line(struct ident_split *split, const char *line, int len) +int split_ident_line(struct ident_split *split, const char *line, size_t len) { const char *cp; size_t span; |
