scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

wcsncat.c (234B)


      1 #include <wchar.h>
      2 
      3 #undef wcsncat
      4 
      5 wchar_t *
      6 wcsncat(wchar_t *restrict s1, const wchar_t *restrict s2, size_t n)
      7 {
      8 	wchar_t *ret;
      9 
     10 	for (ret = s1; *s1; ++s1)
     11 		;
     12 	while (n-- > 0 && *s2)
     13 		*s1++ = *s2++;
     14 	*s1 = '\0';
     15 
     16 	return ret;
     17 
     18 }