2 * $Id: strdup.c,v 1.2 2002/02/27 15:51:20 dfs Exp $
4 * Copyright (C) 1996 Lars Fenneberg and Christian Graefe
6 * This file is provided under the terms and conditions of the GNU general
7 * public license, version 2 or any later version, incorporated herein by
18 * Purpose: strdup replacement for systems which lack it
22 char *strdup(char *str)
29 if ((p = (char *)malloc(strlen(str)+1)) == NULL)
32 return strcpy(p, str);