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
5a37d7d1
Commit
5a37d7d1
authored
May 16, 1997
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renamed strndup to my_strndup to avoid conflict witth GNU libc.
parent
082d2891
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
Modules/cPickle.c
Modules/cPickle.c
+8
-5
No files found.
Modules/cPickle.c
View file @
5a37d7d1
...
...
@@ -490,7 +490,7 @@ readline_other(Unpicklerobject *self, char **s) {
static
char
*
strndup
(
char
*
s
,
int
l
)
my_
strndup
(
char
*
s
,
int
l
)
{
char
*
r
;
UNLESS
(
r
=
malloc
((
l
+
1
)
*
sizeof
(
char
)))
return
(
char
*
)
PyErr_NoMemory
();
...
...
@@ -1974,7 +1974,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
=
my_
strndup
(
s
,
len
))
return
-
1
;
errno
=
0
;
l
=
strtol
(
s
,
&
endptr
,
0
);
...
...
@@ -2084,7 +2084,7 @@ load_long(Unpicklerobject *self) {
static
PyObject
*
arg
=
0
;
if
((
len
=
(
*
self
->
readline_func
)(
self
,
&
s
))
<
0
)
return
-
1
;
UNLESS
(
s
=
strndup
(
s
,
len
))
return
-
1
;
UNLESS
(
s
=
my_
strndup
(
s
,
len
))
return
-
1
;
UNLESS
(
l
=
PyLong_FromString
(
s
,
&
end
,
0
))
goto
finally
;
...
...
@@ -2110,7 +2110,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
=
my_
strndup
(
s
,
len
))
return
-
1
;
errno
=
0
;
d
=
strtod
(
s
,
&
endptr
);
...
...
@@ -2220,7 +2220,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
=
my_
strndup
(
s
,
len
))
return
-
1
;
UNLESS
(
eval_dict
)
UNLESS
(
eval_dict
=
Py_BuildValue
(
"{s{}}"
,
"__builtins__"
))
...
...
@@ -3873,6 +3873,9 @@ initcPickle() {
/****************************************************************************
$Log$
Revision 2.7 1997/05/16 16:36:52 guido
Renamed strndup to my_strndup to avoid conflict witth GNU libc.
Revision 2.6 1997/05/13 18:00:44 guido
Use compile-time test for 64-bit hardware instead of run-time test.
This silences some compilers.
...
...
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