home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.ncftp.com
/
ftp.ncftp.com.zip
/
ftp.ncftp.com
/
libncftp
/
libncftp-3.2.5-src.zip
/
libncftp-3.2.5
/
Strn
/
StrFree.c
< prev
next >
Wrap
C/C++ Source or Header
|
2001-11-19
|
495b
|
37 lines
#include "syshdrs.h"
#ifdef PRAGMA_HDRSTOP
# pragma hdrstop
#endif
#ifndef HAVE_STRDUP
char *
strdup(const char *const src)
{
size_t len;
char *dst;
if (src != NULL) {
len = strlen(src) + 1;
dst = malloc(len);
if (dst != NULL) {
(void) memcpy(dst, src, len);
return (dst);
}
}
return (NULL);
} /* strdup */
#endif /* HAVE_STRDUP */
void
StrFree(char **dst)
{
if (dst != (char **) 0) {
if (*dst != NULL) {
free((void *) *dst);
*dst = NULL;
}
}
} /* StrFree */