summaryrefslogtreecommitdiff
path: root/usr.bin/ssh/ssh-keyscan.c
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2009-01-22 10:02:35 +0000
committerDamien Miller <djm@cvs.openbsd.org>2009-01-22 10:02:35 +0000
commit0435102032a11e65c85556d97788aaa493e961c5 (patch)
tree427ca5c5b89340e1a6b64f29a1cdd06d754864f6 /usr.bin/ssh/ssh-keyscan.c
parenta0c3482df2bba2a7b24e534b155079910aed219d (diff)
make a2port() return -1 when it encounters an invalid port number
rather than 0, which it will now treat as valid (needed for future work) adjust current consumers of a2port() to check its return value is <= 0, which in turn required some things to be converted from u_short => int make use of int vs. u_short consistent in some other places too feedback & ok markus@
Diffstat (limited to 'usr.bin/ssh/ssh-keyscan.c')
-rw-r--r--usr.bin/ssh/ssh-keyscan.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/ssh/ssh-keyscan.c b/usr.bin/ssh/ssh-keyscan.c
index 40a9966b17c..2edfc29db3f 100644
--- a/usr.bin/ssh/ssh-keyscan.c
+++ b/usr.bin/ssh/ssh-keyscan.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-keyscan.c,v 1.77 2008/11/01 11:14:36 sobrado Exp $ */
+/* $OpenBSD: ssh-keyscan.c,v 1.78 2009/01/22 10:02:34 djm Exp $ */
/*
* Copyright 1995, 1996 by David Mazieres <dm@lcs.mit.edu>.
*
@@ -730,7 +730,7 @@ main(int argc, char **argv)
break;
case 'p':
ssh_port = a2port(optarg);
- if (ssh_port == 0) {
+ if (ssh_port <= 0) {
fprintf(stderr, "Bad port '%s'\n", optarg);
exit(1);
}