scc

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

xstrdup.c (158B)


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