Issue #988: Use safe string functions for copying values

Fix coverity issues in #988 by using safe string functions
`STRNCAT` uses `MAXPATHL` on the src argument, not on the dst argument. So appending `"**"` could overflow `NameBuff`, because no size check was made for dst.