summaryrefslogtreecommitdiffstats
path: root/Modules/socketmodule.c
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2004-09-28 02:19:40 (GMT)
committerRaymond Hettinger <python@rcn.com>2004-09-28 02:19:40 (GMT)
commit87de0ca74131e9edf4c2816c7428c60af8dd2ea3 (patch)
tree2b3270bfe2d283ad8153de3606ca20b2c37fd256 /Modules/socketmodule.c
parent6429a4727e4bb8bcb0d3deefaefe195e63e6bb6e (diff)
downloadcpython-87de0ca74131e9edf4c2816c7428c60af8dd2ea3.zip
cpython-87de0ca74131e9edf4c2816c7428c60af8dd2ea3.tar.gz
cpython-87de0ca74131e9edf4c2816c7428c60af8dd2ea3.tar.bz2
Silence a compiler warning by supplying the correct argument type to
the htons() function.
Diffstat (limited to 'Modules/socketmodule.c')
-rw-r--r--Modules/socketmodule.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index 6054c18..521a51f 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -2944,10 +2944,10 @@ otherwise any protocol will match.");
static PyObject *
socket_getservbyport(PyObject *self, PyObject *args)
{
- int port;
+ unsigned short port;
char *proto=NULL;
struct servent *sp;
- if (!PyArg_ParseTuple(args, "i|s:getservbyport", &port, &proto))
+ if (!PyArg_ParseTuple(args, "H|s:getservbyport", &port, &proto))
return NULL;
Py_BEGIN_ALLOW_THREADS
sp = getservbyport(htons(port), proto);