From: Junio C Hamano Date: Tue, 26 Jan 2010 20:52:00 GMT Subject: Re: [PATCH 1/4] Add xmallocz() Message-ID: <7vwrz4y4gf.fsf@alter.siamese.dyndns.org> In-Reply-To: <7v1vhczj95.fsf@alter.siamese.dyndns.org> Junio C Hamano writes: > I'd rather see the function lose the NUL termination; if that makes the > behaviour inconsistent with its name, perhaps it is better to rename the > function; perhaps xmalloc1() to denote that it overallocates by one? Actually I take that back---all the callers do benefit from the allocator giving a buffer that is pre-terminated with NUL. We can also lose "buf[size] = 0" from unpack_sha1_rest() patch.