From 2b60a54adb3b0bf5a9b927708085492b816a6015 Mon Sep 17 00:00:00 2001 From: Ralph Corderoy Date: Wed, 23 Aug 2017 22:50:33 +0100 Subject: [PATCH] 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. --- uip/mhbuildsbr.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) 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. */ -- 2.56.0