about summary refs log tree commit diff
path: root/main.c
diff options
context:
space:
mode:
authorNakidai <nakidai@disroot.org>2026-01-06 14:39:22 +0300
committerNakidai <nakidai@disroot.org>2026-01-06 14:39:22 +0300
commit3a256ec9bd62c3a1d053730c65a8945287e5a8e5 (patch)
tree585cf53fa0c5d5f50899e043932179c4472446d2 /main.c
parent833c53b1ad3338677056445c32c490cac0a08875 (diff)
downloadlibreircd-3a256ec9bd62c3a1d053730c65a8945287e5a8e5.tar.gz
libreircd-3a256ec9bd62c3a1d053730c65a8945287e5a8e5.zip
Use strtoul instead of strtod
I really thought strtod was converting to integers...
Diffstat (limited to 'main.c')
-rw-r--r--main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/main.c b/main.c
index 8be182a..66b3f7a 100644
--- a/main.c
+++ b/main.c
@@ -37,8 +37,8 @@ main(int argc, char **argv)
 			errx(1, "usage: %s hostname bindaddr port", argv[0]);
 	hostname = argv[1];
 	host = argv[2];
-	port = strtod(argv[3], &p);
-	if (*p || port <= 0 || port > 65535)
+	port = strtoul(argv[3], &p, 10);
+	if (*p || !port || port > 65535)
 		errx(1, "invalid port");
 
 #ifdef __OpenBSD__