@matheusbsbs / matheus-bagliano / commits / 0956a6db7a
Fork 0

Fix type-mismatch compiler warning from diff_populate_filespec()

The type of the size member of filespec is ulong, while strbuf_detach expects a size_t pointer. This patch should fix the warning: Signed-off-by: Junio C Hamano <gitster@pobox.com>

René Scharfe committed Dec 18, 2008 at 17:56 UTC 0956a6db7ae3a93c7bce62c1e3a6e0795055ad9f
1 file changed +2 -1
diff.c
+2 -1
@@ -1778,7 +1778,8 @@ int diff_populate_filespec(struct diff_filespec *s, int size_only)
1778
1779 if (strbuf_readlink(&sb, s->path, s->size))
1780 goto err_empty;
1781 - s->data = strbuf_detach(&sb, &s->size);
1781 + s->size = sb.len;
1782 + s->data = strbuf_detach(&sb, NULL);
1783 s->should_free = 1;
1784 return 0;
1785 }