if (lpResults->lpOutString)
for (i = 0; i < nSet && lpString[i] != 0; ++i)
lpResults->lpOutString[i] = lpString[i];
What about a strncpy here:
Be aware that strncyp() rarely DTRT, in particular: - it doesn't guarantee to zero terminate the target - it is required to zero fill the target buffer Neither of these is usually desirable.
Many systems have a strlcpy() function which does what you want much more often.
OTOH is the target buffer can be too short with valid data, they you need to (typically) dynamically allocate a buffer.
David