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. */
7
@deftypefn Replacement char* xstrdup (const char *@var{s})
9
Duplicates a character string without fail, using @code{xmalloc} to
16
#include <sys/types.h>
24
#include "libiberty.h"
30
register size_t len = strlen (s) + 1;
31
register char *ret = xmalloc (len);