~ubuntu-branches/ubuntu/oneiric/bogofilter/oneiric

« back to all changes in this revision

Viewing changes to src/xstrdup.c

  • Committer: Bazaar Package Importer
  • Author(s): Clint Adams
  • Date: 2004-06-27 09:22:31 UTC
  • Revision ID: james.westby@ubuntu.com-20040627092231-u26smic0nhp7rl4z
Tags: upstream-0.92.0
ImportĀ upstreamĀ versionĀ 0.92.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* (C) 2002 by Matthias Andree, redistributable according to the terms
 
2
 * of the GNU General Public License, v2.
 
3
 *
 
4
 * $Id: xstrdup.c,v 1.4 2004/02/25 04:51:58 relson Exp $
 
5
 *
 
6
 */
 
7
 
 
8
#include <string.h>
 
9
#include "xmalloc.h"
 
10
#include "xstrdup.h"
 
11
 
 
12
char *xstrdup(const char *s) {
 
13
    size_t l = strlen(s) + 1;
 
14
    char *t = xmalloc(l);
 
15
    memcpy(t, s, l);
 
16
    return t;
 
17
}