repo.or.cz
/
python.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Issue #6986: Fix crash in the JSON C accelerator when called with the
[python.git]
/
Python
/
strdup.c
blob
20187e0f0a7571f26f97df79b1da40716076c441
1
/* strdup() replacement (from stdwin, if you must know) */
2
3
#include
"pgenheaders.h"
4
5
char
*
6
strdup
(
const char
*
str
)
7
{
8
if
(
str
!=
NULL
) {
9
register
char
*
copy
=
malloc
(
strlen
(
str
) +
1
);
10
if
(
copy
!=
NULL
)
11
return
strcpy
(
copy
,
str
);
12
}
13
return
NULL
;
14
}