Merge branch 'bc/fix-cherry-pick-root'
[gitweb.git] / builtin / pack-objects.c
index 3756cf36ee5dd6fb963af2ab62b0d474fcabd4bb..d5a8db1bb6c14b02db9f7f534fcbaf4dc46994ba 100644 (file)
@@ -431,7 +431,7 @@ static int write_one(struct sha1file *f,
        written_list[nr_written++] = &e->idx;
 
        /* make sure off_t is sufficiently large not to wrap */
-       if (*offset > *offset + size)
+       if (signed_add_overflows(*offset, size))
                die("pack too large for current definition of off_t");
        *offset += size;
        return 1;