~vcs-imports/mammoth-replicator/trunk

« back to all changes in this revision

Viewing changes to src/port/strdup.c

  • Committer: alvherre
  • Date: 2005-12-16 21:24:52 UTC
  • Revision ID: svn-v4:db760fc0-0f08-0410-9d63-cc6633f64896:trunk:1
Initial import of the REL8_0_3 sources from the Pgsql CVS repository.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*-------------------------------------------------------------------------
 
2
 *
 
3
 * strdup.c
 
4
 *        copies a null-terminated string.
 
5
 *
 
6
 * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
 
7
 * Portions Copyright (c) 1994, Regents of the University of California
 
8
 *
 
9
 *
 
10
 * IDENTIFICATION
 
11
 *        $PostgreSQL: pgsql/src/port/strdup.c,v 1.6 2004-12-31 22:03:53 pgsql Exp $
 
12
 *
 
13
 *-------------------------------------------------------------------------
 
14
 */
 
15
 
 
16
#include <string.h>
 
17
#include <stdlib.h>
 
18
#include "strdup.h"
 
19
 
 
20
char *
 
21
strdup(char const * string)
 
22
{
 
23
        char       *nstr;
 
24
 
 
25
        nstr = strcpy((char *) malloc(strlen(string) + 1), string);
 
26
        return nstr;
 
27
}