From 79b43270a70143f97ba58c13cc9d055339b44cbe Mon Sep 17 00:00:00 2001
From: Matt Johnston <matt@ucc.asn.au>
Date: Tue, 15 Dec 2015 22:09:55 +0800
Subject: [PATCH] A few minor style fixes

---
 cli-main.c    |  6 +++---
 cli-runopts.c | 17 ++++++++++-------
 cli-tcpfwd.c  |  5 +++--
 session.h     |  2 +-
 svr-session.c |  3 +--
 5 files changed, 18 insertions(+), 15 deletions(-)

diff --git a/cli-main.c b/cli-main.c
index 9506759d..3cfc02d6 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 3c70332a..fad9428d 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 4d46b94e..fec5dbaa 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 08995732..77e1bcd8 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 c3785626..f777b5f3 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);
-- 
GitLab