Re: [PATCH 1/4] Add xmallocz()
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 26, 2010, 20:52 UTC
- Message-ID
- <7vwrz4y4gf.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <7v1vhczj95.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> 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.