From: Ralph Corderoy Date: Sun, 7 May 2017 21:35:41 +0000 (+0100) Subject: Split some comma-operator terms into separate statements. X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/3d4623ef62a6ee5b91e3b20e5ed4c938ebba2b05?ds=sidebyside Split some comma-operator terms into separate statements. Some uses of the comma operator weren't the idiomatic `p++, len--'. Split its terms into two statements instead, e.g. `close(fd); fd = -1'. --- diff --git a/sbr/datetime.c b/sbr/datetime.c index 48f02d45..693c49ea 100644 --- a/sbr/datetime.c +++ b/sbr/datetime.c @@ -95,7 +95,8 @@ parse_datetime (const char *datetime, const char *zone, int dst, set_dotw (tws); /* set_dotw() sets TW_SIMP. Replace that with TW_SEXP so that dasctime() outputs the dotw before the date instead of after. */ - tws->tw_flags &= ~TW_SDAY, tws->tw_flags |= TW_SEXP; + tws->tw_flags &= ~TW_SDAY; + tws->tw_flags |= TW_SEXP; /* For the call to dmktime(): - don't need tw_yday diff --git a/sbr/dtime.c b/sbr/dtime.c index 5a61f9ae..481cfe6e 100644 --- a/sbr/dtime.c +++ b/sbr/dtime.c @@ -386,7 +386,8 @@ set_dotw (struct tws *tw) if (tw->tw_wday < 0) tw->tw_wday += 7; - tw->tw_flags &= ~TW_SDAY, tw->tw_flags |= TW_SIMP; + tw->tw_flags &= ~TW_SDAY; + tw->tw_flags |= TW_SIMP; } diff --git a/uip/distsbr.c b/uip/distsbr.c index 640b30a5..91eb0a8b 100644 --- a/uip/distsbr.c +++ b/uip/distsbr.c @@ -129,10 +129,14 @@ ready_msg (char *msgnam) char *cp = NULL; m_getfld_state_t gstate = 0; - if (hdrfd != NOTOK) - close (hdrfd), hdrfd = NOTOK; - if (txtfd != NOTOK) - close (txtfd), txtfd = NOTOK; + if (hdrfd != NOTOK) { + close (hdrfd); + hdrfd = NOTOK; + } + if (txtfd != NOTOK) { + close (txtfd); + txtfd = NOTOK; + } if ((ifp = fopen (msgnam, "r")) == NULL) adios (msgnam, "unable to open message"); diff --git a/uip/mhparse.c b/uip/mhparse.c index 983324e7..b1749515 100644 --- a/uip/mhparse.c +++ b/uip/mhparse.c @@ -659,9 +659,11 @@ get_ctinfo (char *cp, CT ct, int magic) for (dp = cp; istoken (*dp); dp++) continue; - c = *dp, *dp = '\0'; + c = *dp; + *dp = '\0'; ci->ci_type = mh_xstrdup(cp); /* store content type */ - *dp = c, cp = dp; + *dp = c; + cp = dp; if (!*ci->ci_type) { inform("invalid %s: field in message %s (empty type)", @@ -693,9 +695,11 @@ get_ctinfo (char *cp, CT ct, int magic) for (dp = cp; istoken (*dp); dp++) continue; - c = *dp, *dp = '\0'; + c = *dp; + *dp = '\0'; ci->ci_subtype = mh_xstrdup(cp); /* store the content subtype */ - *dp = c, cp = dp; + *dp = c; + cp = dp; if (!*ci->ci_subtype) { inform("invalid %s: field in message %s (empty subtype for \"%s\")", @@ -906,9 +910,11 @@ get_dispo (char *cp, CT ct, int buildflag) for (dp = cp; istoken (*dp); dp++) continue; - c = *dp, *dp = '\0'; + c = *dp; + *dp = '\0'; ct->c_dispo_type = mh_xstrdup(cp); /* store disposition type */ - *dp = c, cp = dp; + *dp = c; + cp = dp; if (*cp == '(' && get_comment (ct->c_file, DISPO_FIELD, &cp, NULL) == NOTOK) return NOTOK; @@ -2008,7 +2014,8 @@ openQuoted (CT ct, char **file) for (ep = (cp = bufp) + cc - 1; cp <= ep; ep--) if (!isspace ((unsigned char) *ep)) break; - *++ep = '\n', ep++; + *++ep = '\n'; + ep++; for (; cp < ep; cp++) { if (quoted > 0) {