home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 9 / FreshFishVol9-CD2.bin / bbs / gnu / libnix-0.8-src.lha / libnix-0.8 / sources / nix / extra / strdup.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-12-12  |  176 b   |  13 lines

  1. #include <string.h>
  2. #include <stdlib.h>
  3. #include <strsup.h>
  4.  
  5. char *strdup(const char *s)
  6. {
  7.   char *s1;
  8.  
  9.   if ((s1=malloc(strlen_plus_one(s))))
  10.     strcpy(s1,s);
  11.   return s1;
  12. }
  13.