repo.or.cz
/
zpugcc
/
jano.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
fixes for host gcc 4.6.1
[zpugcc/jano.git]
/
toolchain
/
gcc
/
newlib
/
libc
/
string
/
strdup_r.c
blob
ef77a58eb9c9c42ecc785e335954618caed29666
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
}