Re: [Patch size_t V3 18/19] Convert tree-walk to size_t
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 17, 2017, 17:53 UTC
- Message-ID
- <xmqqshgqgjxx.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <1502914591-26215-19-git-send-email-martin@mail.zuhause>
Martin Koegler <martin.koegler@chello.at> writes:
Show 8 quoted lines
> From: Martin Koegler <martin.koegler@chello.at> > > Signed-off-by: Martin Koegler <martin.koegler@chello.at> > --- > tree-walk.c | 17 +++++++++-------- > tree-walk.h | 4 ++-- > tree.h | 2 +- > 3 files changed, 12 insertions(+), 11 deletions(-)
In this one, I did not find anything suspicious.
Show 18 quoted lines
> diff --git a/tree-walk.c b/tree-walk.c
> index 7c9f9e3..a7d8b2a 100644
> --- a/tree-walk.c
> +++ b/tree-walk.c
> @@ -22,10 +22,11 @@ static const char *get_mode(const char *str, unsigned int *modep)
> return str;
> }
>
> -static int decode_tree_entry(struct tree_desc *desc, const char *buf, unsigned long size, struct strbuf *err)
> +static int decode_tree_entry(struct tree_desc *desc, const char *buf, size_t size, struct strbuf *err)
> {
> const char *path;
> - unsigned int mode, len;
> + unsigned int mode;
> + size_t len;
>
> if (size < 23 || buf[size - 21]) {
> strbuf_addstr(err, _("too-short tree object"));The original was especially bad around here, as it didn't even use ulong. The conversion makes sense.
Thanks.