Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2023-02-05 13:36:28 +0300
committerJunio C Hamano <gitster@pobox.com>2023-02-07 01:31:03 +0300
commit1b4a38d741a4f256c76ae5bffd3c8a52e05927b2 (patch)
tree5032502ec5289006308d576d618a71e80d317b3e /cache.h
parent844ede312b4e988881b6e27e352f469d8ab80b2a (diff)
read-cache: use size_t for {base,df}_name_compare()
Support names of any length in base_name_compare() and df_name_compare() by using size_t for their length parameters. They pass the length on to memcmp(3), which also takes it as a size_t. Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/cache.h b/cache.h
index 07d40b0964..dfa014c3c2 100644
--- a/cache.h
+++ b/cache.h
@@ -1609,8 +1609,10 @@ int repo_interpret_branch_name(struct repository *r,
int validate_headref(const char *ref);
-int base_name_compare(const char *name1, int len1, int mode1, const char *name2, int len2, int mode2);
-int df_name_compare(const char *name1, int len1, int mode1, const char *name2, int len2, int mode2);
+int base_name_compare(const char *name1, size_t len1, int mode1,
+ const char *name2, size_t len2, int mode2);
+int df_name_compare(const char *name1, size_t len1, int mode1,
+ const char *name2, size_t len2, int mode2);
int name_compare(const char *name1, size_t len1, const char *name2, size_t len2);
int cache_name_stage_compare(const char *name1, int len1, int stage1, const char *name2, int len2, int stage2);