mirror of
https://github.com/python/cpython.git
synced 2025-07-15 23:35:23 +00:00
sprintf -> PyOS_snprintf in some "obviously safe" cases.
Also changed <>-style #includes to ""-style in some places where the former didn't make sense.
This commit is contained in:
parent
05bd787c6c
commit
885d457709
15 changed files with 61 additions and 42 deletions
|
@ -1768,9 +1768,11 @@ PySocketSock_repr(PySocketSockObject *s)
|
|||
return NULL;
|
||||
}
|
||||
#endif
|
||||
sprintf(buf,
|
||||
"<socket object, fd=%ld, family=%d, type=%d, protocol=%d>",
|
||||
(long)s->sock_fd, s->sock_family, s->sock_type, s->sock_proto);
|
||||
PyOS_snprintf(buf, sizeof(buf),
|
||||
"<socket object, fd=%ld, family=%d, type=%d, protocol=%d>",
|
||||
(long)s->sock_fd, s->sock_family,
|
||||
s->sock_type,
|
||||
s->sock_proto);
|
||||
return PyString_FromString(buf);
|
||||
}
|
||||
|
||||
|
@ -3056,7 +3058,8 @@ NTinit(void)
|
|||
"WSAStartup failed: requested version not supported");
|
||||
break;
|
||||
default:
|
||||
sprintf(buf, "WSAStartup failed: error code %d", ret);
|
||||
PyOS_snprintf(buf, sizeof(buf),
|
||||
"WSAStartup failed: error code %d", ret);
|
||||
PyErr_SetString(PyExc_ImportError, buf);
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue