Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
fe471a82
Commit
fe471a82
authored
Aug 20, 1997
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renamed strndup to pystrndup, to avoid conflicting prototype
in GNU libc on some platforms.
parent
7ff78790
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
Modules/cPickle.c
Modules/cPickle.c
+9
-5
No files found.
Modules/cPickle.c
View file @
fe471a82
...
...
@@ -504,7 +504,7 @@ readline_other(Unpicklerobject *self, char **s) {
static
char
*
strndup
(
char
*
s
,
int
l
)
py
strndup
(
char
*
s
,
int
l
)
{
char
*
r
;
UNLESS
(
r
=
malloc
((
l
+
1
)
*
sizeof
(
char
)))
return
(
char
*
)
PyErr_NoMemory
();
...
...
@@ -2013,7 +2013,7 @@ load_int(Unpicklerobject *self) {
long
l
;
if
((
len
=
(
*
self
->
readline_func
)(
self
,
&
s
))
<
0
)
return
-
1
;
UNLESS
(
s
=
strndup
(
s
,
len
))
return
-
1
;
UNLESS
(
s
=
py
strndup
(
s
,
len
))
return
-
1
;
errno
=
0
;
l
=
strtol
(
s
,
&
endptr
,
0
);
...
...
@@ -2121,7 +2121,7 @@ load_long(Unpicklerobject *self) {
int
len
,
res
=
-
1
;
if
((
len
=
(
*
self
->
readline_func
)(
self
,
&
s
))
<
0
)
return
-
1
;
UNLESS
(
s
=
strndup
(
s
,
len
))
return
-
1
;
UNLESS
(
s
=
py
strndup
(
s
,
len
))
return
-
1
;
UNLESS
(
l
=
PyLong_FromString
(
s
,
&
end
,
0
))
goto
finally
;
...
...
@@ -2147,7 +2147,7 @@ load_float(Unpicklerobject *self) {
double
d
;
if
((
len
=
(
*
self
->
readline_func
)(
self
,
&
s
))
<
0
)
return
-
1
;
UNLESS
(
s
=
strndup
(
s
,
len
))
return
-
1
;
UNLESS
(
s
=
py
strndup
(
s
,
len
))
return
-
1
;
errno
=
0
;
d
=
strtod
(
s
,
&
endptr
);
...
...
@@ -2257,7 +2257,7 @@ load_string(Unpicklerobject *self) {
static
PyObject
*
eval_dict
=
0
;
if
((
len
=
(
*
self
->
readline_func
)(
self
,
&
s
))
<
0
)
return
-
1
;
UNLESS
(
s
=
strndup
(
s
,
len
))
return
-
1
;
UNLESS
(
s
=
py
strndup
(
s
,
len
))
return
-
1
;
UNLESS
(
eval_dict
)
UNLESS
(
eval_dict
=
Py_BuildValue
(
"{s{}}"
,
"__builtins__"
))
...
...
@@ -3912,6 +3912,10 @@ initcPickle() {
/****************************************************************************
$Log$
Revision 2.9 1997/08/20 23:38:57 guido
Renamed strndup to pystrndup, to avoid conflicting prototype
in GNU libc on some platforms.
Revision 2.8 1997/08/13 03:14:37 guido
cPickle release 0.3 from Jim Fulton
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment