summaryrefslogtreecommitdiff
path: root/builtin/ls-tree.c
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2022-03-23 09:13:05 (GMT)
committerJunio C Hamano <gitster@pobox.com>2022-03-23 18:38:39 (GMT)
commit132ceda40f5fe6e53ff7189a941f7e77a165cb7e (patch)
tree01924e311c4a4508e782d0a278a7d74d467a86b1 /builtin/ls-tree.c
parent26f6d4d5a015ae95b0818140b6edf297e78e4e67 (diff)
downloadgit-132ceda40f5fe6e53ff7189a941f7e77a165cb7e.zip
git-132ceda40f5fe6e53ff7189a941f7e77a165cb7e.tar.gz
git-132ceda40f5fe6e53ff7189a941f7e77a165cb7e.tar.bz2
ls-tree: use "size_t", not "int" for "struct strbuf"'s "len"
The "struct strbuf"'s "len" member is a "size_t", not an "int", so let's change our corresponding types accordingly. This also changes the "len" and "speclen" variables, which are likewise used to store the return value of strlen(), which returns "size_t", not "int". Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/ls-tree.c')
-rw-r--r--builtin/ls-tree.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/builtin/ls-tree.c b/builtin/ls-tree.c
index 3f0225b..eecc748 100644
--- a/builtin/ls-tree.c
+++ b/builtin/ls-tree.c
@@ -31,7 +31,7 @@ static const char * const ls_tree_usage[] = {
NULL
};
-static int show_recursive(const char *base, int baselen, const char *pathname)
+static int show_recursive(const char *base, size_t baselen, const char *pathname)
{
int i;
@@ -43,7 +43,7 @@ static int show_recursive(const char *base, int baselen, const char *pathname)
for (i = 0; i < pathspec.nr; i++) {
const char *spec = pathspec.items[i].match;
- int len, speclen;
+ size_t len, speclen;
if (strncmp(base, spec, baselen))
continue;
@@ -65,7 +65,7 @@ static int show_tree(const struct object_id *oid, struct strbuf *base,
const char *pathname, unsigned mode, void *context)
{
int retval = 0;
- int baselen;
+ size_t baselen;
enum object_type type = OBJ_BLOB;
if (S_ISGITLINK(mode)) {