Blob


1 #include <u.h>
2 #include <libc.h>
4 char*
5 strdup(char *s)
6 {
7 char *t;
8 int l;
10 l = strlen(s);
11 t = malloc(l+1);
12 if(t == nil)
13 return nil;
14 memmove(t, s, l+1);
15 return t;
16 }