repo.or.cz
/
python
/
dscho.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Class around PixMap objects that allows more python-like access. By Joe Strout.
[python/dscho.git]
/
Python
/
strdup.c
blob
9168b4fe5d3bdb29ff578bdf62cf0f9f84919669
1
/* strdup() replacement (from stdwin, if you must know) */
2
3
#include
"pgenheaders.h"
4
5
char
*
6
strdup
(
str
)
7
const char
*
str
;
8
{
9
if
(
str
!=
NULL
) {
10
register
char
*
copy
=
malloc
(
strlen
(
str
) +
1
);
11
if
(
copy
!=
NULL
)
12
return
strcpy
(
copy
,
str
);
13
}
14
return
NULL
;
15
}