summaryrefslogtreecommitdiffstats
path: root/Modules/socketmodule.c
diff options
context:
space:
mode:
authorMarc-André Lemburg <mal@egenix.com>2001-07-31 18:05:33 (GMT)
committerMarc-André Lemburg <mal@egenix.com>2001-07-31 18:05:33 (GMT)
commit03d1b1814b367baf8a52389b5a7d7805dba1f68a (patch)
tree81892ac6a1c4fd799e9768fe2c24b70a8a360a89 /Modules/socketmodule.c
parent77707673f4a623580a3a1cbc494129511004ec2b (diff)
downloadcpython-03d1b1814b367baf8a52389b5a7d7805dba1f68a.zip
cpython-03d1b1814b367baf8a52389b5a7d7805dba1f68a.tar.gz
cpython-03d1b1814b367baf8a52389b5a7d7805dba1f68a.tar.bz2
Enable PyOS_snprintf() et al. during alpha phase of 2.2.0 and
add another use case to the socketmodule.
Diffstat (limited to 'Modules/socketmodule.c')
-rw-r--r--Modules/socketmodule.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index 16b0852..706ca78 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -2349,11 +2349,7 @@ PySocket_getaddrinfo(PyObject *self, PyObject *args)
return NULL;
}
if (PyInt_Check(pobj)) {
-#ifndef HAVE_SNPRINTF
- sprintf(pbuf, "%ld", PyInt_AsLong(pobj));
-#else
- snprintf(pbuf, sizeof(pbuf), "%ld", PyInt_AsLong(pobj));
-#endif
+ PyOS_snprintf(pbuf, sizeof(pbuf), "%ld", PyInt_AsLong(pobj));
pptr = pbuf;
} else if (PyString_Check(pobj)) {
pptr = PyString_AsString(pobj);
@@ -2424,11 +2420,7 @@ PySocket_getnameinfo(PyObject *self, PyObject *args)
n = PyArg_ParseTuple(sa, "si|ii", &hostp, &port, &flowinfo, scope_id);
if (n == 0)
goto fail;
-#ifdef HAVE_SNPRINTF
- snprintf(pbuf, sizeof(pbuf), "%d", port);
-#else
- sprintf(pbuf, "%d", port);
-#endif
+ PyOS_snprintf(pbuf, sizeof(pbuf), "%d", port);
memset(&hints, 0, sizeof(hints));
hints.ai_family = PF_UNSPEC;
error = getaddrinfo(hostp, pbuf, &hints, &res);