This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Coverity is flagging a potential problem because it sees a check for
authorNicholas Clark <nick@ccl4.org>
Sun, 16 Apr 2006 19:06:19 +0000 (19:06 +0000)
committerNicholas Clark <nick@ccl4.org>
Sun, 16 Apr 2006 19:06:19 +0000 (19:06 +0000)
NULL and assumes that this means that the variable host could be
NULL. It can't, and the check added in change 13291 was a little bit
more than the minimal solution needed for the bug report
[ID 20011126.148]
Hence remove the NULL check.

p4raw-id: //depot/perl@27851

ext/Socket/Socket.xs

index 2650cac..48f30d9 100644 (file)
@@ -231,10 +231,7 @@ inet_aton(host)
        {
        struct in_addr ip_address;
        struct hostent * phe;
-       int ok =
-               (host != NULL) &&
-               (*host != '\0') &&
-               inet_aton(host, &ip_address);
+       int ok = (*host != '\0') && inet_aton(host, &ip_address);
 
        if (!ok && (phe = gethostbyname(host))) {
                Copy( phe->h_addr, &ip_address, phe->h_length, char );