summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-02-26 18:10:24 -0800
committerJunio C Hamano <gitster@pobox.com>2024-02-26 18:10:24 -0800
commit274400998b0a2da64d20e9fa95b288bf1403459c (patch)
tree520059d779f2d3e93ab4ba91e4bc9e0bb8d37313 /object.c
parentcf47fb7ec7e183a1a1e521a540862fba3c2a89eb (diff)
parentf0e578c69cd91a554179c09dab6989f6eb0e2910 (diff)
Merge branch 'rs/use-xstrncmpz'
Code clean-up. * rs/use-xstrncmpz: use xstrncmpz()
Diffstat (limited to 'object.c')
-rw-r--r--object.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/object.c b/object.c
index 2c61e4c862..e6a1c4d905 100644
--- a/object.c
+++ b/object.c
@@ -47,8 +47,7 @@ int type_from_string_gently(const char *str, ssize_t len, int gentle)
len = strlen(str);
for (i = 1; i < ARRAY_SIZE(object_type_strings); i++)
- if (!strncmp(str, object_type_strings[i], len) &&
- object_type_strings[i][len] == '\0')
+ if (!xstrncmpz(object_type_strings[i], str, len))
return i;
if (gentle)