mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-19 04:49:25 +08:00
9087163804
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
17 lines
281 B
C
17 lines
281 B
C
#include <reent.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
|
|
char *
|
|
_strdup_r (struct _reent *reent_ptr,
|
|
const char *str)
|
|
{
|
|
size_t len = strlen (str) + 1;
|
|
char *copy = _malloc_r (reent_ptr, len);
|
|
if (copy)
|
|
{
|
|
memcpy (copy, str, len);
|
|
}
|
|
return copy;
|
|
}
|