From: Lars Schneider Date: Thu, 15 Feb 2018 15:27:05 +0000 (+0100) Subject: strbuf: remove unnecessary NUL assignment in xstrdup_tolower() X-Git-Tag: v2.18.0-rc0~95^2~9 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/a8270b0980f88a918f9135e02e86ac6143848d95 strbuf: remove unnecessary NUL assignment in xstrdup_tolower() 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 Signed-off-by: Junio C Hamano --- diff --git a/strbuf.c b/strbuf.c index 8007be8fba..490f7850e9 100644 --- a/strbuf.c +++ b/strbuf.c @@ -781,7 +781,6 @@ char *xstrdup_tolower(const char *string) result = xmallocz(len); for (i = 0; i < len; i++) result[i] = tolower(string[i]); - result[i] = '\0'; return result; }