summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--cli-main.c6
-rw-r--r--cli-runopts.c17
-rw-r--r--cli-tcpfwd.c5
-rw-r--r--session.h2
-rw-r--r--svr-session.c3
5 files changed, 18 insertions, 15 deletions
diff --git a/cli-main.c b/cli-main.c
index 9506759..3cfc02d 100644
--- a/cli-main.c
+++ b/cli-main.c
@@ -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);
}
diff --git a/session.h b/session.h
index 0899573..77e1bcd 100644
--- a/session.h
+++ b/session.h
@@ -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(&timesec);