diff options
author | Lucien Van Elsen <lwvanels@mit.edu> | 1992-08-14 08:11:48 +0000 |
---|---|---|
committer | Lucien Van Elsen <lwvanels@mit.edu> | 1992-08-14 08:11:48 +0000 |
commit | 045924807edb845bc6268acd14591d00b690e8bd (patch) | |
tree | 3372fdbb95fa6a0508d0648d467d443cdd9a1b6f | |
parent | cf23bbdc2bb66c3522649eda85983c502c6bbf99 (diff) |
saber complains about pure assignment statements in ifs-
-rw-r--r-- | server/access.c | 4 | ||||
-rw-r--r-- | server/bdump.c | 12 | ||||
-rw-r--r-- | server/class.c | 4 | ||||
-rw-r--r-- | server/dispatch.c | 21 | ||||
-rw-r--r-- | server/kopt.c | 2 | ||||
-rw-r--r-- | server/kstuff.c | 4 | ||||
-rw-r--r-- | server/main.c | 2 | ||||
-rw-r--r-- | server/server.c | 7 | ||||
-rw-r--r-- | server/uloc.c | 4 |
9 files changed, 32 insertions, 28 deletions
diff --git a/server/access.c b/server/access.c index c0ee56e..4482176 100644 --- a/server/access.c +++ b/server/access.c @@ -198,9 +198,9 @@ access_setup (int first) return; } while (fgets(class_name, 512, registry) != NULL) { - if (colon_idx = index(class_name, ':')) + if ((colon_idx = (char *) index(class_name, ':')) != NULL) *colon_idx = '\0'; - else if (len = strlen(class_name)) + else if ((len = strlen(class_name)) != 0) class_name[len - 1] = '\0'; acl = 0; if (!first) { diff --git a/server/bdump.c b/server/bdump.c index d82f3e5..b391a69 100644 --- a/server/bdump.c +++ b/server/bdump.c @@ -28,6 +28,7 @@ static char rcsid_bdump_c[] = "$Id$"; /* inconsistent header files... */ #ifdef SignalIgnore #undef SIG_IGN +fubar #define SIG_IGN SignalIgnore #undef SIG_DFL #define SIG_DFL SignalDefault @@ -347,7 +348,7 @@ bdump_send(void) return; } if ((retval = SendKerberosData(live_socket, &ticket, "zephyr", - "zephyr"))) { + "zephyr")) != 0) { syslog(LOG_ERR,"bdump_send: SendKerberosData: %s", error_message (retval)); cleanup(server, omask); @@ -363,7 +364,7 @@ bdump_send(void) } #endif /* KERBEROS */ - if ((retval = setup_file_pointers())) { + if ((retval = setup_file_pointers()) != 0) { syslog (LOG_WARNING, "bdump_send: can't set up file pointers: %s", error_message (retval)); cleanup (server, omask); @@ -512,7 +513,7 @@ bdump_get_v1_guts (notice, auth, who, server) return; } if ((retval = SendKerberosData(live_socket, &ticket, "zephyr", - "zephyr"))) { + "zephyr")) != 0) { syslog(LOG_ERR,"bdump_get: %s", error_message (retval)); cleanup(server, omask); @@ -539,7 +540,7 @@ bdump_get_v1_guts (notice, auth, who, server) return; } #endif /* KERBEROS */ - if ((retval = setup_file_pointers())) { + if ((retval = setup_file_pointers()) != 0) { syslog (LOG_WARNING, "bdump_get: can't set up file pointers: %s", error_message (retval)); cleanup (server, omask); @@ -897,7 +898,8 @@ sbd_loop(from) #if 1 zdbug((LOG_DEBUG, "his state req")); #endif - if (server = server_which_server(&bogus_from)) { + if ((server = server_which_server(&bogus_from)) != + NULLZSDT) { if ((retval = bdump_send_loop(server, zeph_version)) != ZERR_NONE) diff --git a/server/class.c b/server/class.c index 4f2bfc0..c959d5d 100644 --- a/server/class.c +++ b/server/class.c @@ -254,7 +254,7 @@ class_lookup(subs) hashval = CLASS_HASHVAL(subs->zst_dest.classname, subs->zst_dest.inst); - if (ptr = class_bucket[hashval]) + if ((ptr = class_bucket[hashval]) != NULLZCT) /* go search the list for the class */ for (ptr2 = ptr->q_forw; ptr2 != ptr; ptr2 = ptr2->q_forw) { /* walk down the list, looking for a match */ @@ -269,7 +269,7 @@ class_lookup(subs) set_ZDestination_hash(&wc_sub.zst_dest); hashval = CLASS_HASHVAL(wc_sub.zst_dest.classname, wc_sub.zst_dest.inst); - if (ptr = class_bucket[hashval]) + if ((ptr = class_bucket[hashval]) != NULLZCT) /* go search the list for the class */ for (ptr2 = ptr->q_forw; ptr2 != ptr; ptr2 = ptr2->q_forw) { /* walk down the list, looking for a match */ diff --git a/server/dispatch.c b/server/dispatch.c index aa1faf6..834386d 100644 --- a/server/dispatch.c +++ b/server/dispatch.c @@ -170,9 +170,9 @@ handle_packet() } pending = server_dequeue(me_server); /* we can do it, remove */ - if (status = ZParseNotice(pending->pend_packet, + if ((status = ZParseNotice(pending->pend_packet, pending->pend_len, - &new_notice)) { + &new_notice)) != ZERR_NONE) { syslog(LOG_ERR, "bad notice parse (%s): %s", inet_ntoa(pending->pend_who.sin_addr), @@ -187,18 +187,18 @@ handle_packet() * nothing in internal queue, go to the external library * queue/socket */ - if (status = ZReceivePacket(input_packet, + if ((status = ZReceivePacket(input_packet, &input_len, - &whoisit)) { + &whoisit)) != ZERR_NONE) { syslog(LOG_ERR, "bad packet receive: %s from %s", error_message(status), inet_ntoa(whoisit.sin_addr)); return; } npackets++; - if (status = ZParseNotice(input_packet, + if ((status = ZParseNotice(input_packet, input_len, - &new_notice)) { + &new_notice)) != ZERR_NONE) { syslog(LOG_ERR, "bad notice parse (%s): %s", inet_ntoa(whoisit.sin_addr), @@ -352,7 +352,7 @@ sendit(notice, auth, who) ZSTRING *z; z = make_zstring(notice->z_class,1); - if (acl = class_get_acl(z)) { + if ((acl = class_get_acl(z)) != NULLZACLT) { free_zstring(z); /* if controlled and not auth, fail */ if (!auth) { @@ -390,7 +390,7 @@ sendit(notice, auth, who) syslog(LOG_WARNING, "sendit addr mismatch: claimed %s, real %s", inet_ntoa(notice->z_sender_addr), buffer); } - if ((clientlist = subscr_match_list(notice))) { + if ((clientlist = subscr_match_list(notice)) != NULLZCLT) { for (ptr = clientlist->q_forw; ptr != clientlist; ptr = ptr->q_forw) { @@ -598,6 +598,7 @@ xmit(notice, dest, auth, client) nacked->na_rexmits = 0; nacked->na_packet = noticepack; + nacked->na_srv_idx = 0; /* XXX */ nacked->na_addr = *dest; nacked->na_packsz = packlen; nacked->na_uid = notice->z_uid; @@ -934,7 +935,7 @@ control_dispatch(notice, auth, who, server) return(ZERR_NONE); } } else if (!strcmp(opcode, CLIENT_UNSUBSCRIBE)) { - if ((client = client_which_client(who,notice))) { + if ((client = client_which_client(who,notice)) != NULLZCNT) { if (strcmp(client->zct_principal->string, notice->z_sender)) { /* you may only cancel for your own clients */ if (server == me_server) @@ -964,7 +965,7 @@ control_dispatch(notice, auth, who, server) } else if (!strcmp(opcode, CLIENT_CANCELSUB)) { /* canceling subscriptions implies I can punt info about this client */ - if ((client = client_which_client(who,notice))) { + if ((client = client_which_client(who,notice)) != NULLZCNT) { if (strcmp(client->zct_principal->string, notice->z_sender)) { /* you may only cancel for your own clients */ if (server == me_server) diff --git a/server/kopt.c b/server/kopt.c index e491815..8a74ed4 100644 --- a/server/kopt.c +++ b/server/kopt.c @@ -317,7 +317,7 @@ krb_rd_req(authent,service,instance,from_addr,ad,fn) if (read_service_key(service,instance,realm,(int) s_kvno, fn,(char *)skey)) return(RD_AP_UNDEC); - if (status = krb_set_key((char *)skey,0)) + if ((status = krb_set_key((char *)skey,0)) != 0) return(status); #endif /* !NOENCRYPTION */ (void) strcpy(st_rlm,realm); diff --git a/server/kstuff.c b/server/kstuff.c index 0524a6c..d47279a 100644 --- a/server/kstuff.c +++ b/server/kstuff.c @@ -333,8 +333,8 @@ ZCheckAuthentication(notice, from) } } - if (result = krb_get_cred(SERVER_SERVICE, SERVER_INSTANCE, - __Zephyr_realm, &cred)) { + if ((result = krb_get_cred(SERVER_SERVICE, SERVER_INSTANCE, + __Zephyr_realm, &cred)) != KSUCCESS) { syslog (LOG_DEBUG, "krb_get_cred failed (%s) ->AUTH_NO (from %s)", krb_err_txt [result], inet_ntoa (from->sin_addr)); return (ZAUTH_NO); diff --git a/server/main.c b/server/main.c index ffafdd5..c9ac3d8 100644 --- a/server/main.c +++ b/server/main.c @@ -163,7 +163,7 @@ main(argc, argv) extern int optind; /* set name */ - if (programname = rindex(argv[0],'/')) + if ((programname = rindex(argv[0],'/')) != NULL) programname++; else programname = argv[0]; diff --git a/server/server.c b/server/server.c index 67c47f8..9de05a8 100644 --- a/server/server.c +++ b/server/server.c @@ -665,7 +665,8 @@ server_recover(client) #if 0 zdbug((LOG_DEBUG,"server recover")); #endif - if ((server = hostm_find_server(&client->zct_sin.sin_addr))) { + if ((server = hostm_find_server(&client->zct_sin.sin_addr)) != + NULLZSDT) { if (server == limbo_server) { #if 0 zdbug((LOG_DEBUG, "no server to recover")); @@ -1651,9 +1652,9 @@ server_send_queue(server) while(server->zs_update_queue) { pending = server_dequeue(server); - if (status = ZParseNotice(pending->pend_packet, + if ((status = ZParseNotice(pending->pend_packet, pending->pend_len, - ¬ice)) { + ¬ice)) != ZERR_NONE) { syslog(LOG_ERR, "ssq bad notice parse (%s): %s", inet_ntoa(pending->pend_who.sin_addr), diff --git a/server/uloc.c b/server/uloc.c index 55140c0..e2f3a5e 100644 --- a/server/uloc.c +++ b/server/uloc.c @@ -625,7 +625,7 @@ ulogin_add_user(notice, exposure, who) (int) exposure)); #endif - if (oldlocs = ulogin_find(notice,1)) { + if ((oldlocs = ulogin_find(notice,1)) != NULLZLT) { #if 0 zdbug((LOG_DEBUG,"ul_add: already here")); #endif @@ -813,7 +813,7 @@ ulogin_find(notice, strict) rlo = 0; rhi = num_locs - 1; /* first index is 0 */ - while (compar = comp_zstring(locations[i].zlt_user, inst)) { + while ((compar = comp_zstring(locations[i].zlt_user, inst)) != 0) { #if 0 zdbug ((LOG_DEBUG, "ulogin_find: comparing %s %s %s %d %d", notice->z_class_inst, |