scc

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

xstrdup.c (209B)


      1 static char sccsid[] = "@(#) ./lib/scc/xstrdup.c";
      2 #include <string.h>
      3 #include <scc/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 }