Re: [PATCH v7 1/7] strbuf: remove unnecessary NUL assignment in xstrdup_tolower()

2018-02-16 Thread Junio C Hamano
Jeff King writes: >> (although the calloc() case is slightly different from mallocz()), >> see: https://public-inbox.org/git/871shum182@evledraar.gmail.com/ > > Hmm. I do think xmallocz is a bit more explicit instruction of "please > NUL-terminate this for me" than xcalloc is. So I don't thin

Re: [PATCH v7 1/7] strbuf: remove unnecessary NUL assignment in xstrdup_tolower()

2018-02-16 Thread Jeff King
On Fri, Feb 16, 2018 at 01:55:02PM +0100, Ævar Arnfjörð Bjarmason wrote: > On Thu, Feb 15, 2018 at 4:27 PM, wrote: > > Since 3733e69464 (use xmallocz to avoid size arithmetic, 2016-02-22) we > > allocate the buffer for the lower case string with xmallocz(). This > > already ensures a NUL at the

Re: [PATCH v7 1/7] strbuf: remove unnecessary NUL assignment in xstrdup_tolower()

2018-02-16 Thread Ævar Arnfjörð Bjarmason
On Thu, Feb 15, 2018 at 4:27 PM, wrote: > Since 3733e69464 (use xmallocz to avoid size arithmetic, 2016-02-22) we > allocate the buffer for the lower case string with xmallocz(). This > already ensures a NUL at the end of the allocated buffer. > > Remove the unnecessary assignment. > [...] >

[PATCH v7 1/7] strbuf: remove unnecessary NUL assignment in xstrdup_tolower()

2018-02-15 Thread lars . schneider
From: Lars Schneider Since 3733e69464 (use xmallocz to avoid size arithmetic, 2016-02-22) we allocate the buffer for the lower case string with xmallocz(). This already ensures a NUL at the end of the allocated buffer. Remove the unnecessary assignment. Signed-off-by: Lars Schneider --- strbu