You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12 lines
251 B

  1. /* strdup() replacement (from stdwin, if you must know) */
  2. char *
  3. strdup(const char *str)
  4. {
  5. if (str != NULL) {
  6. char *copy = malloc(strlen(str) + 1);
  7. if (copy != NULL)
  8. return strcpy(copy, str);
  9. }
  10. return NULL;
  11. }