author | Junio C Hamano <gitster@pobox.com> | |
Mon, 12 Sep 2011 01:03:38 +0000 (18:03 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 12 Sep 2011 01:03:38 +0000 (18:03 -0700) | ||
commit | eb726f2d760dd78915e4a24f014ab411a165daa3 | |
tree | 600d0909cc2f3ab183e603a8aec88054f39c99a2 | tree | snapshot |
parent | 509d59705ee07094bcc56b49a17ba0ae983da50f | commit | diff |
fsck: do not abort upon finding an empty blob
Asking fwrite() to write one item of size bytes results in fwrite()
reporting "I wrote zero item", when size is zero. Instead, we could
ask it to write "size" items of 1 byte and expect it to report that
"I wrote size items" when it succeeds, with any value of size,
including zero.
Noticed and reported by BJ Hargrave.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Asking fwrite() to write one item of size bytes results in fwrite()
reporting "I wrote zero item", when size is zero. Instead, we could
ask it to write "size" items of 1 byte and expect it to report that
"I wrote size items" when it succeeds, with any value of size,
including zero.
Noticed and reported by BJ Hargrave.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/fsck.c | diff | blob | history |