src/irc.c
changeset 59 e8f15b159e19
parent 58 500a5ea7fcb8
child 60 67a32e9d95f2
--- a/src/irc.c
+++ b/src/irc.c
@@ -62,12 +62,13 @@
             break;
         }
         close (csocket);
+        csocket = -1;
     }
 
     if (result != NULL)
         freeaddrinfo (result);
 
-    if (csocket < 0) {
+    if (csocket == -1) {
         perror ("Cannot connect");
         return NULL;
     }