1 /* $Id: strdup.c,v 1.4 2002/10/29 04:45:42 rex Exp $
4 * COPYRIGHT: See COPYING in the top level directory
5 * PROJECT: ReactOS POSIX+ Subsystem
6 * FILE: subsys/psx/lib/psxdll/string/strdup.c
7 * PURPOSE: Duplicate a string
8 * PROGRAMMER: KJK::Hyperion <noog@libero.it>
15 #include <psx/debug.h>
17 char *strdup(const char *s1
)
22 HINT("strdup() is inefficient - consider dropping zero-terminated strings");
29 /* allocate enough buffer space for s1 and the null terminator */
30 pchRetBuf
= (char *) malloc(nStrLen
+ 1);
33 /* memory allocation failed */
37 strcpy(pchRetBuf
, s1
);