summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/make/str.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/make/str.c b/usr.bin/make/str.c
index 87557a8..03ff7a4a 100644
--- a/usr.bin/make/str.c
+++ b/usr.bin/make/str.c
@@ -112,9 +112,12 @@ str_concat(s1, s2, flags)
result[len1++] = '/';
}
- /* copy second string plus EOS into place */
+ /* copy second string into place */
if (len2)
- memcpy(result + len1, s2, len2 + 1);
+ memcpy(result + len1, s2, len2);
+
+ /* Terminate. */
+ result[len1 + len2] = '\0';
/* free original strings */
if (flags & STR_DOFREE) {
OpenPOWER on IntegriCloud