diff options
author | Matt Johnston <matt@ucc.asn.au> | 2015-12-15 22:09:55 +0800 |
---|---|---|
committer | Matt Johnston <matt@ucc.asn.au> | 2015-12-15 22:09:55 +0800 |
commit | 79b43270a70143f97ba58c13cc9d055339b44cbe (patch) | |
tree | 0817d629170c6f92e6260a363676bf21ad86e1a5 | |
parent | 3d33e65a3546193e05eb469d7c5a9b2b0931420d (diff) |
A few minor style fixes
-rw-r--r-- | cli-main.c | 6 | ||||
-rw-r--r-- | cli-runopts.c | 17 | ||||
-rw-r--r-- | cli-tcpfwd.c | 5 | ||||
-rw-r--r-- | session.h | 2 | ||||
-rw-r--r-- | svr-session.c | 3 |
5 files changed, 18 insertions, 15 deletions
@@ -164,11 +164,11 @@ static void cli_proxy_cmd(int *sock_in, int *sock_out, pid_t *pid_out) { } } -static void killchild(int signo) -{ +static void killchild(int signo) { kill_proxy_command(); - if (signo) + if (signo) { _exit(1); + } exit(1); } #endif /* ENABLE_CLI_PROXYCMD */ diff --git a/cli-runopts.c b/cli-runopts.c index 3c70332..fad9428 100644 --- a/cli-runopts.c +++ b/cli-runopts.c @@ -828,17 +828,20 @@ static int match_extendedopt(const char** strptr, const char *optname) { int optlen = strlen(optname); const char *str = *strptr; - while (isspace(*str)) + while (isspace(*str)) { ++str; + } - if (strncasecmp(str, optname, optlen) != 0) + if (strncasecmp(str, optname, optlen) != 0) { return DROPBEAR_FAILURE; + } str += optlen; while (isspace(*str) || (!seen_eq && *str == '=')) { - if (*str == '=') + if (*str == '=') { seen_eq = 1; + } ++str; } @@ -846,12 +849,12 @@ static int match_extendedopt(const char** strptr, const char *optname) { return DROPBEAR_SUCCESS; } -static int parse_flag_value(const char *value) -{ - if (strcmp(value, "yes") == 0 || strcmp(value, "true") == 0) +static int parse_flag_value(const char *value) { + if (strcmp(value, "yes") == 0 || strcmp(value, "true") == 0) { return 1; - else if (strcmp(value, "no") == 0 || strcmp(value, "false") == 0) + } else if (strcmp(value, "no") == 0 || strcmp(value, "false") == 0) { return 0; + } dropbear_exit("Bad yes/no argument '%s'", value); } diff --git a/cli-tcpfwd.c b/cli-tcpfwd.c index 4d46b94..fec5dba 100644 --- a/cli-tcpfwd.c +++ b/cli-tcpfwd.c @@ -67,10 +67,11 @@ void fwd_failed(const char* format, ...) va_list param; va_start(param, format); - if (cli_opts.exit_on_fwd_failure) + if (cli_opts.exit_on_fwd_failure) { _dropbear_exit(EXIT_FAILURE, format, param); - else + } else { _dropbear_log(LOG_WARNING, format, param); + } va_end(param); } @@ -305,7 +305,7 @@ struct clientsession { struct AgentkeyList *agentkeys; /* Keys to use for public-key auth */ #endif - int proxy_cmd_pid; + pid_t proxy_cmd_pid; }; /* Global structs storing the state */ diff --git a/svr-session.c b/svr-session.c index c378562..f777b5f 100644 --- a/svr-session.c +++ b/svr-session.c @@ -215,8 +215,7 @@ void svr_dropbear_log(int priority, const char* format, va_list param) { havetrace = debug_trace; #endif - if (!opts.usingsyslog || havetrace) - { + if (!opts.usingsyslog || havetrace) { struct tm * local_tm = NULL; timesec = time(NULL); local_tm = localtime(×ec); |