Skip to content

Commit a8270b0

Browse files
larsxschneidergitster
authored andcommitted
strbuf: remove unnecessary NUL assignment in xstrdup_tolower()
Since 3733e69 (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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 8462ff4 commit a8270b0

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

strbuf.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,6 @@ char *xstrdup_tolower(const char *string)
781781
result = xmallocz(len);
782782
for (i = 0; i < len; i++)
783783
result[i] = tolower(string[i]);
784-
result[i] = '\0';
785784
return result;
786785
}
787786

0 commit comments

Comments
 (0)