diff options
Diffstat (limited to 'bin/sh/memalloc.c')
-rw-r--r-- | bin/sh/memalloc.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/bin/sh/memalloc.c b/bin/sh/memalloc.c index 119f12e..a04020f 100644 --- a/bin/sh/memalloc.c +++ b/bin/sh/memalloc.c @@ -180,6 +180,18 @@ stunalloc(pointer p) } +char * +stsavestr(const char *s) +{ + char *p; + size_t len; + + len = strlen(s); + p = stalloc(len + 1); + memcpy(p, s, len + 1); + return p; +} + void setstackmark(struct stackmark *mark) |