1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-18 17:42:25 +03:00
Files
postgres/src/port/strdup.c
2003-11-29 19:52:15 +00:00

28 lines
657 B
C

/*-------------------------------------------------------------------------
*
* strdup.c
* copies a null-terminated string.
*
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/port/strdup.c,v 1.4 2003/11/29 19:52:13 pgsql Exp $
*
*-------------------------------------------------------------------------
*/
#include <string.h>
#include <stdlib.h>
#include "strdup.h"
char *
strdup(char const * string)
{
char *nstr;
nstr = strcpy((char *) malloc(strlen(string) + 1), string);
return nstr;
}