summaryrefslogtreecommitdiff
path: root/miniircd
diff options
context:
space:
mode:
authorJoel Rosdahl <joel@rosdahl.net>2003-12-11 18:36:00 +0000
committerJoel Rosdahl <joel@rosdahl.net>2011-08-21 15:53:50 +0200
commit7465545c05574c984b0f5580e6797db6c223ff44 (patch)
treef775ca9f2df9c28b56e4aff9b361e9713b51d451 /miniircd
parentfe6e9de1fd37d3ed338281338462724acb12dfcf (diff)
downloadminiircd-7465545c05574c984b0f5580e6797db6c223ff44.tar.gz
miniircd-7465545c05574c984b0f5580e6797db6c223ff44.zip
Handle bad port specification
Diffstat (limited to 'miniircd')
-rwxr-xr-xminiircd8
1 files changed, 7 insertions, 1 deletions
diff --git a/miniircd b/miniircd
index 1e2a94c..0c02899 100755
--- a/miniircd
+++ b/miniircd
@@ -796,7 +796,13 @@ def main(argv):
elif opt in ("-p", "--password"):
password = val.lower()
elif opt == "--ports":
- ports = [int(x) for x in re.split("[,\s]+", val)]
+ ports = []
+ for port in re.split("[,\s]+", val):
+ try:
+ ports.append(int(port))
+ except ValueError:
+ sys.stderr.write("Bad port: \"%s\".\n" % port)
+ sys.exit(1)
elif opt in ("-v", "--verbose"):
verbose = True
server = Server(ports, password, verbose)