xstrdup.c revision 33965
1/* xstrdup.c -- Duplicate a string in memory, using xmalloc.
2   This trivial function is in the public domain.
3   Ian Lance Taylor, Cygnus Support, December 1995.  */
4
5#include "ansidecl.h"
6#include "libiberty.h"
7
8char *
9xstrdup (s)
10     const char *s;
11{
12  char *ret;
13
14  ret = xmalloc (strlen (s) + 1);
15  strcpy (ret, s);
16  return ret;
17}
18