Fix for Coverity CID71708 - buffer not terminated

strncpy doesn't leave room for a NULL terminator if the string is longer than the size you pass it, so we must pass it one less than the full length to ensure the string is always terminated.