~ubuntu-branches/ubuntu/karmic/python-scipy/karmic

« back to all changes in this revision

Viewing changes to Lib/xplt/src/play/all/pstrcpy.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel T. Chen (new)
  • Date: 2005-03-16 02:15:29 UTC
  • Revision ID: james.westby@ubuntu.com-20050316021529-xrjlowsejs0cijig
Tags: upstream-0.3.2
ImportĀ upstreamĀ versionĀ 0.3.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * pstrcpy.c -- $Id: pstrcpy.c,v 1.1 2003/03/08 15:26:47 travo Exp $
 
3
 * strcpy that p_mallocs its destination
 
4
 *
 
5
 * Copyright (c) 1998.  See accompanying LEGAL file for details.
 
6
 */
 
7
 
 
8
#include "config.h"
 
9
#include "pstdlib.h"
 
10
#include <string.h>
 
11
 
 
12
char *
 
13
p_strcpy(const char *s)
 
14
{
 
15
  if (s) {
 
16
    char *d = p_malloc(strlen(s)+1);
 
17
    strcpy(d, s);
 
18
    return d;
 
19
  } else {
 
20
    return 0;
 
21
  }
 
22
}