scc

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

strxfrm.c (189B)


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