summaryrefslogtreecommitdiff
path: root/lib/ZLocations.c
diff options
context:
space:
mode:
authorGravatar John Kohl <jtkohl@mit.edu>1988-06-25 13:40:41 +0000
committerGravatar John Kohl <jtkohl@mit.edu>1988-06-25 13:40:41 +0000
commit26c4be47e09354bf87a87e9eec106b143f2463d2 (patch)
treec9debdf584280b565f27db9c56a429a270742bc1 /lib/ZLocations.c
parenta81930766e6fedbcafd1e72b7251435a4dfed01f (diff)
z_port is unsigned; ZGetWGPort is signed, so we need an intermediate
value holder to compare to -1.
Diffstat (limited to 'lib/ZLocations.c')
-rw-r--r--lib/ZLocations.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/ZLocations.c b/lib/ZLocations.c
index 2b4882e..0ad2490 100644
--- a/lib/ZLocations.c
+++ b/lib/ZLocations.c
@@ -63,11 +63,10 @@ Z_SendLocation(class, opcode, auth, format)
char *bptr[3];
char *display, *ttyp;
struct hostent *hent;
+ short wg_port = ZGetWGPort();
notice.z_kind = ACKED;
- notice.z_port = ZGetWGPort();
- if (notice.z_port == -1)
- notice.z_port = 0;
+ notice.z_port = (u_short) ((wg_port == -1) ? 0 : wg_port);
notice.z_class = class;
notice.z_class_inst = ZGetSender();
notice.z_opcode = opcode;