| 7 | #include <stdlib.h> |
| 8 | |
| 9 | char *strdup(const char *s) |
| 10 | { |
| 11 | if (!ENV_RAMSTAGE) |
| 12 | dead_code(); /* This can't be used without malloc(). */ |
| 13 | |
| 14 | size_t sz = strlen(s) + 1; |
| 15 | char *d = malloc(sz); |
| 16 | if (d) |
| 17 | memcpy(d, s, sz); |
| 18 | return d; |
| 19 | } |
| 20 | |
| 21 | char *strconcat(const char *s1, const char *s2) |
| 22 | { |