From 7d57ffc92fe378f7a445a841609adba86bcef0b3 Mon Sep 17 00:00:00 2001 From: Ralph Corderoy Date: Wed, 23 Aug 2017 22:16:32 +0100 Subject: [PATCH] Flip logic, moving goto from else- to then-block. Thus removing the need for the `else'. --- uip/install-mh.c | 15 ++++++--------- uip/mhparse.c | 7 ++++--- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/uip/install-mh.c b/uip/install-mh.c index 61853195..414a4877 100644 --- a/uip/install-mh.c +++ b/uip/install-mh.c @@ -128,16 +128,13 @@ main (int argc, char **argv) cp = concat (mypath, "/", "Mail", NULL); if (stat (cp, &st) != NOTOK) { - if (S_ISDIR(st.st_mode)) { - cp = concat ("You already have the standard nmh directory \"", - cp, "\".\nDo you want to use it for nmh? ", NULL); - if (read_switch (cp, anoyes)) - pathname = "Mail"; - else - goto query; - } else { + if (!S_ISDIR(st.st_mode)) goto query; - } + cp = concat ("You already have the standard nmh directory \"", + cp, "\".\nDo you want to use it for nmh? ", NULL); + if (!read_switch (cp, anoyes)) + goto query; + pathname = "Mail"; } else { if (autof) puts("I'm going to create the standard nmh path for you."); diff --git a/uip/mhparse.c b/uip/mhparse.c index 4a031b0e..4b5d16be 100644 --- a/uip/mhparse.c +++ b/uip/mhparse.c @@ -1841,7 +1841,10 @@ openBase64 (CT ct, char **file) *cp = '\0'; if (decodeBase64 (buffer, &decoded, &decoded_len, ct->c_type == CT_TEXT, - ct->c_digested ? digest : NULL) == OK) { + ct->c_digested ? digest : NULL) != OK) + goto clean_up; + + { size_t i; unsigned char *decoded_p = decoded; for (i = 0; i < decoded_len; ++i) { @@ -1864,8 +1867,6 @@ openBase64 (CT ct, char **file) } } } - } else { - goto clean_up; } fseek (ct->c_fp, 0L, SEEK_SET); -- 2.56.0