diff options
author | Tim Peters <tim.peters@gmail.com> | 2001-11-28 20:27:42 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2001-11-28 20:27:42 (GMT) |
commit | 885d457709c1d680c899dc3d035a47c8fb514cfa (patch) | |
tree | d16b3a6f89208a1b46b786958a316ef9075d3fab /Modules/socketmodule.c | |
parent | 05bd787c6cd55f29d43465de621778221e0fc46e (diff) | |
download | cpython-885d457709c1d680c899dc3d035a47c8fb514cfa.zip cpython-885d457709c1d680c899dc3d035a47c8fb514cfa.tar.gz cpython-885d457709c1d680c899dc3d035a47c8fb514cfa.tar.bz2 |
sprintf -> PyOS_snprintf in some "obviously safe" cases.
Also changed <>-style #includes to ""-style in some places where the
former didn't make sense.
Diffstat (limited to 'Modules/socketmodule.c')
-rw-r--r-- | Modules/socketmodule.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index 2b27e71..eccee4d 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -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; } |