1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#include "config.h" /* ** Copyright 1998 - 1999 Double Precision, Inc. See COPYING for ** distribution information. */ /* */ #include <stdlib.h> #include <string.h> char *strdup(const char *p) { char *s; if ((s=malloc(strlen(p)+1)) != 0) strcpy(s, p); return (s); }