On Tue, 10 Sep 2013, Junio C Hamano wrote:
quoted hunk ↗ jump to hunk
quoted
packv4-parse.c: allow tree entry copying from a canonical tree object
This one needed a small fix-up to make it compile.
I do not particularly like reusing that "size" variable, but it
seemed to be dead at that point, so...
packv4-parse.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/packv4-parse.c b/packv4-parse.c
index f96acc1..3f95ed4 100644
--- a/packv4-parse.c
+++ b/packv4-parse.c
@@ -365,13 +365,14 @@ static int copy_canonical_tree_entries(struct packed_git *p, off_t offset,
update_tree_entry(&desc);
end = desc.buffer;
- if (end - from > *sizep) {
+ size = (const char *)end - (const char *)from;
+ if (size > *sizep) {
BTW, a simpler fix might simply involve declaring those 2 variables as
const char * up front which would remove the need for any cast.
Nicolas