From: lars.schneider@autodesk.com Date: Sat, 06 Jan 2018 00:48:02 GMT Subject: [PATCH v3 1/7] strbuf: remove unnecessary NUL assignment in xstrdup_tolower() Message-ID: <20180106004808.77513-2-lars.schneider@autodesk.com> In-Reply-To: <20180106004808.77513-1-lars.schneider@autodesk.com> 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 --- strbuf.c | 1 - 1 file changed, 1 deletion(-) diff --git a/strbuf.c b/strbuf.c index 323c49ceb3..b5d03a5029 100644 --- a/strbuf.c +++ b/strbuf.c @@ -756,7 +756,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; } -- 2.15.1