Skip to content
Snippets Groups Projects
Commit ede1f547 authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

unix/modsocket: Use snprintf(), as defined by lib/utils/printf.c.

parent 295ea124
Branches
No related tags found
No related merge requests found
...@@ -435,7 +435,7 @@ STATIC mp_obj_t mod_socket_getaddrinfo(mp_uint_t n_args, const mp_obj_t *args) { ...@@ -435,7 +435,7 @@ STATIC mp_obj_t mod_socket_getaddrinfo(mp_uint_t n_args, const mp_obj_t *args) {
// it may seem stupid, we need to convert int to str // it may seem stupid, we need to convert int to str
if (MP_OBJ_IS_SMALL_INT(args[1])) { if (MP_OBJ_IS_SMALL_INT(args[1])) {
unsigned port = (unsigned short)MP_OBJ_SMALL_INT_VALUE(args[1]); unsigned port = (unsigned short)MP_OBJ_SMALL_INT_VALUE(args[1]);
sprintf(buf, "%u", port); snprintf(buf, sizeof(buf), "%u", port);
serv = buf; serv = buf;
hints.ai_flags = AI_NUMERICSERV; hints.ai_flags = AI_NUMERICSERV;
#ifdef __UCLIBC_MAJOR__ #ifdef __UCLIBC_MAJOR__
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment