From: Junio C Hamano Date: Wed, 12 Dec 2007 08:56:35 GMT Subject: Re: 'git fast-export' is crashing on the gcc repo Message-ID: <7vy7c08f5o.fsf@gitster.siamese.dyndns.org> In-Reply-To: <854peo8fm5.fsf@lola.goethe.zz> David Kastrup writes: > Junio C Hamano 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(...);