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