TS-1475: use strlcpy to guarantee null-termination

Coverity #1022063