mirror of
https://github.com/gcc-mirror/gcc.git
synced 2024-11-21 13:40:47 +00:00
6599da043e
From-SVN: r14877
18 lines
338 B
C
18 lines
338 B
C
/* xstrdup.c -- Duplicate a string in memory, using xmalloc.
|
|
This trivial function is in the public domain.
|
|
Ian Lance Taylor, Cygnus Support, December 1995. */
|
|
|
|
#include "ansidecl.h"
|
|
#include "libiberty.h"
|
|
|
|
char *
|
|
xstrdup (s)
|
|
const char *s;
|
|
{
|
|
char *ret;
|
|
|
|
ret = xmalloc (strlen (s) + 1);
|
|
strcpy (ret, s);
|
|
return ret;
|
|
}
|