Silence a compiler warning by supplying the correct argument type to

the htons() function.
This commit is contained in:
Raymond Hettinger 2004-09-28 02:19:40 +00:00
parent 6429a4727e
commit 87de0ca741

View file

@ -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);