From 26c4be47e09354bf87a87e9eec106b143f2463d2 Mon Sep 17 00:00:00 2001 From: John Kohl Date: Sat, 25 Jun 1988 13:40:41 +0000 Subject: z_port is unsigned; ZGetWGPort is signed, so we need an intermediate value holder to compare to -1. --- lib/ZLocations.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib/ZLocations.c') 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; -- cgit v1.2.3