summaryrefslogtreecommitdiff
path: root/usr.bin/systat
diff options
context:
space:
mode:
authorChad Loder <cloder@cvs.openbsd.org>2005-03-13 19:00:46 +0000
committerChad Loder <cloder@cvs.openbsd.org>2005-03-13 19:00:46 +0000
commit8e34ec014e579d68d252f4a6c77f5c8fc1bfc15e (patch)
tree49f881ec8ae9531caf63bc4a7a08f03bb7686837 /usr.bin/systat
parent3f052ef3c7357e0ac7dd5622dc4a6025eb6fb782 (diff)
Use correct byte order when printing out port numbers.
OK jaredy@, tdeval@, hshoexer@
Diffstat (limited to 'usr.bin/systat')
-rw-r--r--usr.bin/systat/netcmds.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/systat/netcmds.c b/usr.bin/systat/netcmds.c
index 0d9a54cbd37..9b555f70f61 100644
--- a/usr.bin/systat/netcmds.c
+++ b/usr.bin/systat/netcmds.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: netcmds.c,v 1.14 2004/09/29 21:59:28 deraadt Exp $ */
+/* $OpenBSD: netcmds.c,v 1.15 2005/03/13 19:00:45 cloder Exp $ */
/* $NetBSD: netcmds.c,v 1.4 1995/05/21 17:14:38 mycroft Exp $ */
/*-
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)netcmds.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: netcmds.c,v 1.14 2004/09/29 21:59:28 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: netcmds.c,v 1.15 2005/03/13 19:00:45 cloder Exp $";
#endif /* not lint */
/*
@@ -94,7 +94,7 @@ netcmd(char *cmd, char *args)
if (prefix(cmd, "reset")) {
selectproto(0);
selecthost(0, 0);
- selectport(-1, 0);
+ selectport(htons(-1), 0);
return (1);
}
if (prefix(cmd, "show")) {
@@ -195,7 +195,7 @@ selectport(long port, int onoff)
{
struct pitem *p;
- if (port == -1) {
+ if (ntohs(port) == -1) {
if (ports == 0)
return (0);
free((char *)ports), ports = 0;
@@ -243,7 +243,7 @@ showports(void)
if (sp)
printw("%s ", sp->s_name);
else
- printw("%d ", p->port);
+ printw("%d ", ntohs(p->port));
}
}