Since len <= strlen(elt) is known, we don't need a str*() function. Let's simply do memcpy() to suppress linter false positive. Fixes #2777.