scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

xstrdup.c (215B)


      1 static char sccsid[] = "@(#) ./lib/scc/xstrdup.c";
      2 #include <string.h>
      3 #include "../../inc/scc.h"
      4 
      5 char *
      6 xstrdup(const char *s)
      7 {
      8 	size_t len = strlen(s) + 1;
      9 	char *p = xmalloc(len);
     10 
     11 	return memcpy(p, s, len);
     12 }