From d15b73353f17ca9ad43c50a6bd4cbce4dd04198e Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Fri, 27 Mar 1992 17:22:00 +0000 Subject: Lint fixes. --- Modules/socketmodule.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index 13644fe..9e305fc 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -375,6 +375,8 @@ sock_avail(s, args) struct timeval timeout; fd_set readers; int n; + if (!getnoarg(args)) + return NULL; timeout.tv_sec = 0; timeout.tv_usec = 0; FD_ZERO(&readers); @@ -529,7 +531,8 @@ sock_recvfrom(s, args) return socket_error(); if (resizestring(&buf, n) < 0) return NULL; - return makepair(buf, makesockaddr(addrbuf, addrlen)); + return makepair(buf, + makesockaddr((struct sockaddr *)addrbuf, addrlen)); } @@ -677,7 +680,7 @@ socket_gethostname(self, args) char buf[1024]; if (!getnoarg(args)) return NULL; - if (gethostname(buf, sizeof buf - 1) < 0) + if (gethostname(buf, (int) sizeof buf - 1) < 0) return socket_error(); buf[sizeof buf - 1] = '\0'; return newstringobject(buf); @@ -691,7 +694,6 @@ socket_gethostbyname(self, args) object *args; { object *name; - struct hostent *hp; struct sockaddr_in addrbuf; if (!getStrarg(args, &name)) return NULL; -- cgit v0.12