1 /* (C) 2002 by Matthias Andree, redistributable according to the terms 2 * of the GNU General Public License, v2. 3 */ 4 5 #include <string.h> 6 #include "xmalloc.h" 7 #include "xstrdup.h" 8 xstrdup(const char * s)9char *xstrdup(const char *s) { 10 size_t l = strlen(s) + 1; 11 char *t = (char *)xmalloc(l); 12 memcpy(t, s, l); 13 return t; 14 } 15