about summary refs log tree commit diff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/main.c b/main.c
index c93a84d..26de6e6 100644
--- a/main.c
+++ b/main.c
@@ -16,6 +16,7 @@
 
 #include "ircd.h"
 
+#include <errno.h>
 #include <stddef.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -38,7 +39,7 @@ main(int argc, char **argv)
 	hostname = argv[1];
 	host = argv[2];
 	port = strtoul(argv[3], &p, 10);
-	if (*p || !port || port > 65535)
+	if (errno || *p || !port || port > 65535)
 		errx(1, "invalid port");
 
 #ifdef __OpenBSD__