Fix pg_dump bug in the database-level collation patch. "datcollate" and
[PostgreSQL.git] / src / port / strdup.c
blob3b5828fe4e13eee0f6c1c0da619a980b11d25292
1 /*-------------------------------------------------------------------------
3 * strdup.c
4 * copies a null-terminated string.
6 * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
7 * Portions Copyright (c) 1994, Regents of the University of California
10 * IDENTIFICATION
11 * $PostgreSQL$
13 *-------------------------------------------------------------------------
16 #include "c.h"
19 char *
20 strdup(const char *string)
22 char *nstr;
24 nstr = (char *) malloc(strlen(string) + 1);
25 if (nstr)
26 strcpy(nstr, string);
27 return nstr;