| commit | f437e56d1d5c8180ee2f93273f78393426efd5f9 | [log] [tgz] |
|---|---|---|
| author | rsc <devnull@localhost> | Wed Jun 09 14:15:47 2004 +0000 |
| committer | rsc <devnull@localhost> | Wed Jun 09 14:15:47 2004 +0000 |
| tree | 61e6ed23e29f65b077c6cb1c2a80f266eab9f6d7 | |
| parent | ca9b36624f0a8074e65cebfbabfee8a824a4d312 [diff] [blame] |
add strdup for debugging.
diff --git a/src/lib9/strdup.c b/src/lib9/strdup.c new file mode 100644 index 0000000..5ca3186 --- /dev/null +++ b/src/lib9/strdup.c
@@ -0,0 +1,17 @@ +#include <u.h> +#include <libc.h> + +char* +strdup(char *s) +{ + char *t; + int l; + + l = strlen(s); + t = malloc(l+1); + if(t == nil) + return nil; + memmove(t, s, l+1); + return t; +} +