Back to index

courier  0.68.2
strdup.c
Go to the documentation of this file.
00001 #include "config.h"
00002 /*
00003 ** Copyright 1998 - 1999 Double Precision, Inc.  See COPYING for
00004 ** distribution information.
00005 */
00006 
00007 
00008 /*
00009 */
00010 #include      <stdlib.h>
00011 #include      <string.h>
00012 
00013 char *strdup(const char *p)
00014 {
00015 char *s;
00016 
00017        if ((s=malloc(strlen(p)+1)) != 0)  strcpy(s, p);
00018        return (s);
00019 }