scc

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

strxfrm.c (188B)


      1 #include <string.h>
      2 #undef strxfrm
      3 
      4 size_t
      5 strxfrm(char * restrict dst, const char * restrict src, size_t n)
      6 {
      7 	size_t len = strlen(src);
      8 
      9 	if (len < n)
     10 		strcpy(dst, src);
     11 	return len;
     12 }