]> granicus.if.org Git - python/commitdiff
Fix compiler warnings. This closes some of the #458880 problem.
authorMartin v. Löwis <martin@v.loewis.de>
Fri, 7 Sep 2001 16:10:00 +0000 (16:10 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Fri, 7 Sep 2001 16:10:00 +0000 (16:10 +0000)
Modules/getaddrinfo.c

index 3745c430d7d11bde2e59904c842e6f61d1088faa..5d137d8340587a47f42093f8448adf17c9091200 100644 (file)
@@ -236,10 +236,8 @@ str_isnumber(p)
 }
 
 int
-getaddrinfo(hostname, servname, hints, res)
-       const char *hostname, *servname;
-       const struct addrinfo *hints;
-       struct addrinfo **res;
+getaddrinfo(const char*hostname, const char*servname,
+            const struct addrinfo *hints, struct addrinfo **res)
 {
        struct addrinfo sentinel;
        struct addrinfo *top = NULL;
@@ -367,15 +365,16 @@ getaddrinfo(hostname, servname, hints, res)
                        if ((sp = getservbyname(servname, proto)) == NULL)
                                ERR(EAI_SERVICE);
                        port = sp->s_port;
-                       if (pai->ai_socktype == GAI_ANY)
+                       if (pai->ai_socktype == GAI_ANY) {
                                if (strcmp(sp->s_proto, "udp") == 0) {
                                        pai->ai_socktype = SOCK_DGRAM;
                                        pai->ai_protocol = IPPROTO_UDP;
                                } else if (strcmp(sp->s_proto, "tcp") == 0) {
-                                       pai->ai_socktype = SOCK_STREAM;
-                                       pai->ai_protocol = IPPROTO_TCP;
-                               } else
-                                       ERR(EAI_PROTOCOL);      /*xxx*/
+                                        pai->ai_socktype = SOCK_STREAM;
+                                        pai->ai_protocol = IPPROTO_TCP;
+                                } else
+                                        ERR(EAI_PROTOCOL);     /*xxx*/
+                        }
                }
        }