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 <larsxschneider@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Lars Schneider committed
Feb 15, 2018 at 16:27 UTC
a8270b0980f88a918f9135e02e86ac6143848d95
1 file changed
-1
strbuf.c
-1
@@ -781,7 +781,6 @@ char *xstrdup_tolower(const char *string)
781
result = xmallocz(len);
782
for (i = 0; i < len; i++)
783
result[i] = tolower(string[i]);
784
- result[i] = '\0';
784
return result;
785
}
786