00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include <sys/types.h>
00017 #ifdef HAVE_CONFIG_H
00018 #include "config.h"
00019 #endif
00020 #ifdef HAVE_STRING_H
00021 #include <string.h>
00022 #endif
00023 #include "ansidecl.h"
00024 #include "libiberty.h"
00025
00026 char *
00027 xstrdup (s)
00028 const char *s;
00029 {
00030 register size_t len = strlen (s) + 1;
00031 register char *ret = xmalloc (len);
00032 memcpy (ret, s, len);
00033 return ret;
00034 }