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
2e24ee8d
Commit
2e24ee8d
authored
Feb 10, 2014
by
Paul Sokolovsky
Browse files
socket: Tighten up int-to-str conversion.
parent
8c25201d
Changes
1
Show whitespace changes
Inline
Side-by-side
unix/socket.c
View file @
2e24ee8d
...
...
@@ -291,8 +291,8 @@ static mp_obj_t mod_socket_getaddrinfo(uint n_args, const mp_obj_t *args) {
// getaddrinfo accepts port in string notation, so however
// it may seem stupid, we need to convert int to str
if
(
MP_OBJ_IS_SMALL_INT
(
args
[
1
]))
{
int
port
=
MP_OBJ_SMALL_INT_VALUE
(
args
[
1
]);
static
char
buf
[
20
];
int
port
=
(
short
)
MP_OBJ_SMALL_INT_VALUE
(
args
[
1
]);
char
buf
[
6
];
sprintf
(
buf
,
"%d"
,
port
);
serv
=
buf
;
}
else
{
...
...
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