- /*
- ** Copyright 1998 - 1999 Double Precision, Inc. See COPYING for
- ** distribution information.
- */
- /*
- ** $Id: strdup.c,v 1.2 1999/12/08 06:00:38 mrsam Exp $
- */
- #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);
- }