fix sock_connect() to return -1 on all errors (Frederick Nacino)
This commit is contained in:
1 parent
656c5d8858
commit
5fc4dfc562
5 files changed
+5
-5
No files matched your search
@@ -138,7 +138,7 @@ main (int argc, char **argv)
|
||||
/* Try to connect to server */
|
||||
sock = sock_connect(server, port);
|
||||
|
||||
if (sock <= 0) { /* there was some error and exit */
|
||||
if (sock < 0) { /* there was some error and exit */
|
||||
fprintf(stderr, "Error: Could not connect to %s:%d\n", server, port);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user