From: Ralph Corderoy Date: Wed, 13 Sep 2017 22:16:50 +0000 (+0100) Subject: ext_hook(): Flip if-statement condition so then-block simply returns. X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/7b4935d717c4ec694b47ead4a9cd691d97932cc2?hp=c576ad2674c37a1c63f004c71049998f38854c64 ext_hook(): Flip if-statement condition so then-block simply returns. No need for rest of function to be in an else-block. --- diff --git a/sbr/ext_hook.c b/sbr/ext_hook.c index 3cde1fd9..f1a9a14a 100644 --- a/sbr/ext_hook.c +++ b/sbr/ext_hook.c @@ -46,20 +46,20 @@ ext_hook(char *hook_name, char *message_file_name_1, char *message_file_name_2) break; } - if (status != OK) { - if (did_message == 0) { - char *msghook; - if ((msghook = context_find("msg-hook")) != NULL) - inform("%s", msghook); - else { - char errbuf[BUFSIZ]; - snprintf(errbuf, sizeof(errbuf), "external hook \"%s\"", hook); - pidstatus(status, stderr, errbuf); - } - did_message = 1; - } - - return NOTOK; - } else + if (status == OK) return OK; + + if (did_message == 0) { + char *msghook; + if ((msghook = context_find("msg-hook")) != NULL) + inform("%s", msghook); + else { + char errbuf[BUFSIZ]; + snprintf(errbuf, sizeof(errbuf), "external hook \"%s\"", hook); + pidstatus(status, stderr, errbuf); + } + did_message = 1; + } + + return NOTOK; }