From: Ralph Corderoy Date: Wed, 23 Aug 2017 21:50:33 +0000 (+0100) Subject: mhbuildsbr.c: Flip logic, moving goto to then-block; no need for else. X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/2b60a54adb3b0bf5a9b927708085492b816a6015 mhbuildsbr.c: Flip logic, moving goto to then-block; no need for else. Also makes more clear a FILE pointer that's probably not fclose()'d. --- diff --git a/uip/mhbuildsbr.c b/uip/mhbuildsbr.c index b1b0f835..1b0b327b 100644 --- a/uip/mhbuildsbr.c +++ b/uip/mhbuildsbr.c @@ -2394,14 +2394,12 @@ extract_headers (CT ct, char *reply_file, FILE **reply_fp) { /* Hack. Use parse_mime() to detect the type/subtype of the reply, which we'll use below. */ tmp_file = getcpy (m_mktemp2 (NULL, invo_name, NULL, NULL)); - if ((tmp_f = fopen (tmp_file, "w")) && - fwrite (buffer, 1, n, tmp_f) == n) { - fclose (tmp_f); - } else { + tmp_f = fopen(tmp_file, "w"); + if (!tmp_f || fwrite(buffer, 1, n, tmp_f) != n) goto failed_to_extract_ct; - } - tmp_ct = parse_mime (tmp_file); + fclose (tmp_f); + tmp_ct = parse_mime (tmp_file); if (tmp_ct) { /* The type and subtype were detected from the reply using parse_mime() above. */