Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
ff3bdea4
Commit
ff3bdea4
authored
Jan 20, 2014
by
Paul Sokolovsky
Browse files
stream_read(): Shrink memory block to actual read size.
parent
decd5972
Changes
1
Hide whitespace changes
Inline
Side-by-side
py/stream.c
View file @
ff3bdea4
...
...
@@ -30,6 +30,7 @@ static mp_obj_t stream_read(uint n_args, const mp_obj_t *args) {
if
(
out_sz
==
-
1
)
{
nlr_jump
(
mp_obj_new_exception_msg_varg
(
MP_QSTR_OSError
,
"[Errno %d]"
,
error
));
}
else
{
buf
=
m_realloc
(
buf
,
sz
+
1
,
out_sz
+
1
);
buf
[
out_sz
]
=
0
;
return
mp_obj_new_str
(
qstr_from_str_take
(
buf
,
/*out_sz,*/
sz
+
1
));
}
...
...
Write
Preview
Supports
Markdown
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