From 7b4935d717c4ec694b47ead4a9cd691d97932cc2 Mon Sep 17 00:00:00 2001 From: Ralph Corderoy Date: Wed, 13 Sep 2017 23:16:50 +0100 Subject: [PATCH] ext_hook(): Flip if-statement condition so then-block simply returns. No need for rest of function to be in an else-block. --- sbr/ext_hook.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) 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; } -- 2.56.0