X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-apply.c;h=8411b38c7963852bffeb6dea1494399e8c9daa02;hb=fed1b5cac0cc3ae324dc004181a276ea16589951;hp=047a60d1a43a24c3e7d086cf9f87cb36835e8495;hpb=66d4035e1099477aa488c24c0c081ee764f85868;p=git.git diff --git a/builtin-apply.c b/builtin-apply.c index 047a60d1a..8411b38c7 100644 --- a/builtin-apply.c +++ b/builtin-apply.c @@ -152,7 +152,7 @@ struct patch { unsigned int is_rename:1; struct fragment *fragments; char *result; - unsigned long resultsize; + size_t resultsize; char old_sha1_prefix[41]; char new_sha1_prefix[41]; struct patch *next; @@ -2651,7 +2651,7 @@ static int apply_patch(int fd, const char *filename, int inaccurate_eof) patch = xcalloc(1, sizeof(*patch)); patch->inaccurate_eof = inaccurate_eof; - nr = parse_chunk(buf.buf + offset, buf.len, patch); + nr = parse_chunk(buf.buf + offset, buf.len - offset, patch); if (nr < 0) break; if (apply_in_reverse)