diff options
author | John Kohl <jtkohl@mit.edu> | 1988-06-25 13:40:41 +0000 |
---|---|---|
committer | John Kohl <jtkohl@mit.edu> | 1988-06-25 13:40:41 +0000 |
commit | 26c4be47e09354bf87a87e9eec106b143f2463d2 (patch) | |
tree | c9debdf584280b565f27db9c56a429a270742bc1 /lib/ZLocations.c | |
parent | a81930766e6fedbcafd1e72b7251435a4dfed01f (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.c | 5 |
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; |