pack-objects: use strcspn(3) in name_cmp_len()
commite65b868d074a38b3049529064bb05df53948761f
authorRené Scharfe <l.s.r@web.de>
Sun, 5 Feb 2023 10:42:27 +0000 (5 11:42 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 6 Feb 2023 22:31:11 +0000 (6 14:31 -0800)
tree1ce37e179db58e1475ed25dee026a452f2188854
parent1b4a38d741a4f256c76ae5bffd3c8a52e05927b2
pack-objects: use strcspn(3) in name_cmp_len()

Call strcspn(3) to find the length of a string terminated by NUL, NL or
slash instead of open-coding it.  Adopt its return type, size_t, to
support strings of arbitrary length.  Use that type in callers as well
for variables and function parameters that receive the return value.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/pack-objects.c