1 2 #include <stddef.h> 3 #include <tchar.h> 4 _tcsncat(_TCHAR * dst,const _TCHAR * src,size_t n)5_TCHAR * _tcsncat(_TCHAR * dst, const _TCHAR * src, size_t n) 6 { 7 if(n != 0) 8 { 9 _TCHAR * d = dst; 10 const _TCHAR * s = src; 11 12 while(*d != 0) ++ d; 13 14 do 15 { 16 if((*d = *s++) == 0) break; 17 18 ++ d; 19 } 20 while (--n != 0); 21 22 *d = 0; 23 } 24 25 return dst; 26 } 27 28 /* EOF */ 29