source: trunk/libs/newlib/src/newlib/libc/string/strdup_r.c @ 444

Last change on this file since 444 was 444, checked in by satin@…, 6 years ago

add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc

File size: 281 bytes
Line 
1#include <reent.h>
2#include <stdlib.h>
3#include <string.h>
4
5char *
6_strdup_r (struct _reent *reent_ptr,
7        const char   *str)
8{
9  size_t len = strlen (str) + 1;
10  char *copy = _malloc_r (reent_ptr, len);
11  if (copy)
12    {
13      memcpy (copy, str, len);
14    }
15  return copy;
16}
Note: See TracBrowser for help on using the repository browser.