blob: 5ca31866fedf265fcf534e508e5be2a6e7107a47 [file] [log] [blame]
rscf437e562004-06-09 14:15:47 +00001#include <u.h>
2#include <libc.h>
3
4char*
5strdup(char *s)
6{
7 char *t;
8 int l;
9
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}
17