Re: 'git fast-export' is crashing on the gcc repo
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 12, 2007, 08:56 UTC
- Message-ID
- <7vy7c08f5o.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <854peo8fm5.fsf@lola.goethe.zz>
David Kastrup <dak@gnu.org> writes:
Show 7 quoted lines
> Junio C Hamano <gitster@pobox.com> writes: > ... >> Still, I like your swapping of size and nmemb parameters, regardless >> of the "don't bother calling fwrite(3) if size is zero" fix. > > I don't. Far too obscure, looks like an unintentional wart waiting to > be corrected.
Oh, I did not mean it in the sense that would be a bugfix, but in the sense that we are writing N instances of 1 byte, not 1 instance of N byte blob, and should express size and nmemb parameters to fwrite(3) as such. IOW, I would have preferred:
if (size && fwrite(buf, 1, size, stdout) != size)
barf(...);