Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. #include <reent.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4.  
  5. char *
  6. _DEFUN (_strdup_r, (reent_ptr, str),
  7.         struct _reent *reent_ptr  _AND
  8.         _CONST char   *str)
  9. {
  10.   size_t len = strlen (str) + 1;
  11.   char *copy = _malloc_r (reent_ptr, len);
  12.   if (copy)
  13.     {
  14.       memcpy (copy, str, len);
  15.     }
  16.   return copy;
  17. }
  18.