From: Art Cancro Date: Thu, 16 Oct 2008 16:18:30 +0000 (+0000) Subject: Trust the compiler to do short-circuit evaluation. X-Git-Tag: v7.86~1844 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=c345df49943fc6991c48a3e8b087d4a0046ac42a Trust the compiler to do short-circuit evaluation. --- diff --git a/webcit/auth.c b/webcit/auth.c index 2e58a710a..af571a48f 100644 --- a/webcit/auth.c +++ b/webcit/auth.c @@ -41,9 +41,9 @@ void display_login(char *mesg) output_headers(1, 1, 2, 0, 0, 0); wprintf("
\n"); - if (mesg != NULL) if (!IsEmptyStr(mesg)) { - stresc(buf, SIZ, mesg, 0, 0); - svprintf(HKEY("MESG"), WCS_STRING, "%s", buf); + if ((mesg != NULL) && (!IsEmptyStr(mesg))) { + stresc(buf, SIZ, mesg, 0, 0); + svprintf(HKEY("MESG"), WCS_STRING, "%s", buf); } svprintf(HKEY("LOGIN_INSTRUCTIONS"), WCS_STRING, @@ -116,9 +116,9 @@ void display_openid_login(char *mesg) output_headers(1, 1, 2, 0, 0, 0); wprintf("
\n"); - if (mesg != NULL) if (!IsEmptyStr(mesg)) { - stresc(buf, SIZ, mesg, 0, 0); - svprintf(HKEY("MESG"), WCS_STRING, "%s", buf); + if ((mesg != NULL) && (!IsEmptyStr(mesg))) { + stresc(buf, SIZ, mesg, 0, 0); + svprintf(HKEY("MESG"), WCS_STRING, "%s", buf); } svprintf(HKEY("LOGIN_INSTRUCTIONS"), WCS_STRING, diff --git a/webcit/event.c b/webcit/event.c index 5bb3efb4f..f073f47b5 100644 --- a/webcit/event.c +++ b/webcit/event.c @@ -337,15 +337,17 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum, } wprintf(""); wprintf(_("Free")); wprintf("  "); wprintf(""); wprintf(_("Busy")); diff --git a/webcit/paging.c b/webcit/paging.c index b36375d87..acfcdd97c 100644 --- a/webcit/paging.c +++ b/webcit/paging.c @@ -304,7 +304,7 @@ void chat_recv(void) { pf.fd = WC->chat_sock; pf.events = POLLIN; pf.revents = 0; - if (poll(&pf, 1, 1) > 0) if (pf.revents & POLLIN) { + if ((poll(&pf, 1, 1) > 0) && (pf.revents & POLLIN)) { ++got_data; /** Temporarily swap the serv and chat sockets during chat talk */ diff --git a/webcit/useredit.c b/webcit/useredit.c index 2446b3c2e..9e2babafa 100644 --- a/webcit/useredit.c +++ b/webcit/useredit.c @@ -496,7 +496,7 @@ TRYAGAIN: } /** If there's no vcard, create one */ - if (vcard_msgnum < 0) if (already_tried_creating_one == 0) { + if ((vcard_msgnum < 0) && (already_tried_creating_one == 0)) { already_tried_creating_one = 1; serv_puts("ENT0 1|||4"); serv_getln(buf, sizeof buf); diff --git a/webcit/webserver.c b/webcit/webserver.c index 5c328b189..ce9affa28 100644 --- a/webcit/webserver.c +++ b/webcit/webserver.c @@ -147,7 +147,7 @@ int ig_uds_server(char *sockpath, int queue_len) if (actual_queue_len < 5) actual_queue_len = 5; i = unlink(sockpath); - if (i != 0) if (errno != ENOENT) { + if ((i != 0) && (errno != ENOENT)) { lprintf(1, "webcit: can't unlink %s: %s\n", sockpath, strerror(errno)); exit(WC_EXIT_BIND);