diff options
Diffstat (limited to 'gcc/cppalloc.c')
-rw-r--r-- | gcc/cppalloc.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/cppalloc.c b/gcc/cppalloc.c index a852d00..880a56d 100644 --- a/gcc/cppalloc.c +++ b/gcc/cppalloc.c @@ -65,3 +65,13 @@ xrealloc (old, size) memory_full (); return ptr; } + +char * +xstrdup (input) + const char *input; +{ + unsigned size = strlen (input); + char *output = xmalloc (size + 1); + strcpy (output, input); + return output; +} |