Check h_errno instead of errno on gethostbyname() failure.
authorJennifer Richards <jennifer@painless-security.com>
Tue, 6 Sep 2016 17:16:48 +0000 (13:16 -0400)
committerJennifer Richards <jennifer@painless-security.com>
Tue, 6 Sep 2016 17:16:48 +0000 (13:16 -0400)
gsscon/gsscon_active.c

index 0b03926..fe4d1e8 100755 (executable)
@@ -54,6 +54,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <netdb.h>
 
 #include <gsscon.h>
 
@@ -85,7 +86,7 @@ int gsscon_connect (const char *inHost, unsigned int inPort, const char *inServi
     
     if (!err) {
         hp = gethostbyname (inHost);
-        if (hp == NULL) { err = errno; }
+        if (hp == NULL) { err = h_errno; }
     }
     
     if (!err) {