Replaced unsafe calls to strncpy with the safer, zero-terminated strlcpy.