]> diplodocus.org Git - nmh/commitdiff
mhbuildsbr.c: Flip logic, moving goto to then-block; no need for else.
authorRalph Corderoy <ralph@inputplus.co.uk>
Wed, 23 Aug 2017 21:50:33 +0000 (22:50 +0100)
committerRalph Corderoy <ralph@inputplus.co.uk>
Wed, 23 Aug 2017 22:31:42 +0000 (23:31 +0100)
Also makes more clear a FILE pointer that's probably not fclose()'d.

uip/mhbuildsbr.c

index b1b0f83..1b0b327 100644 (file)
@@ -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));
         /* 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;
             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. */
         if (tmp_ct) {
             /* The type and subtype were detected from the reply
                using parse_mime() above. */