diff options
author | René Scharfe <l.s.r@web.de> | 2023-02-05 11:36:28 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-02-06 23:31:03 +0100 |
commit | 1b4a38d741a4f256c76ae5bffd3c8a52e05927b2 (patch) | |
tree | 5032502ec5289006308d576d618a71e80d317b3e /cache.h | |
parent | Sync with maint-2.38 (diff) | |
download | git-1b4a38d741a4f256c76ae5bffd3c8a52e05927b2.tar.xz git-1b4a38d741a4f256c76ae5bffd3c8a52e05927b2.zip |
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.h | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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); |