home *** CD-ROM | disk | FTP | other *** search
/ linuxmafia.com 2016 / linuxmafia.com.tar / linuxmafia.com / pub / palmos / pippy-0.6beta-src.tar.gz / pippy-0.6beta-src.tar / pippy-0.6beta-src / src / Python / strdup.c < prev    next >
C/C++ Source or Header  |  2000-12-21  |  262b  |  16 lines

  1. /* strdup() replacement (from stdwin, if you must know) */
  2.  
  3. #include "pgenheaders.h"
  4.  
  5. char *
  6. strdup(str)
  7.     const char *str;
  8. {
  9.     if (str != NULL) {
  10.         register char *copy = malloc(strlen(str) + 1);
  11.         if (copy != NULL)
  12.             return strcpy(copy, str);
  13.     }
  14.     return NULL;
  15. }
  16.