These two functions are similar in function and are easy to use wrong.
LPTSTR Lstrcpyn (LPTSTR lpString1, LPCTSTR lpString2, int imaxlength);
TCHAR lpString2 lpString1 WCHAR values for Unicode versions.
from the lpString2 to the lpString1 Replication imaxlength bytes, including/0, which is the actual copy of iMaxLength-1 bytes
Char *strncpy ( char *strdest, const char *strsource, count );
The strncpy function copies the initial count characters of strsource to strdest and R Eturns strdest. If Count is less than or equal to the length of strsource, a null character are not appended Automaticall Y to the copied string. If Count is greater than the length of strsource, the destination string was padded with null characters Up to length count. The behavior of strncpy is undefined if the source and destination strings overlap.
Fromstrsource tocopy Count bytes in strdest, ifstrsource length is not enough, the following bytes are/0 padded
A little difference between Lstrcpyn and strncpy