URI:
       tstrdup.c - plan9port - [fork] Plan 9 from user space
  HTML git clone git://src.adamsgaard.dk/plan9port
   DIR Log
   DIR Files
   DIR Refs
   DIR README
   DIR LICENSE
       ---
       tstrdup.c (173B)
       ---
            1 #include <u.h>
            2 #include <libc.h>
            3 
            4 char*
            5 strdup(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 }