[PATCH 04/12] Uniform coding style: conditional statement

Antonio Borneo borneo.antonio at gmail.com
Sun Mar 10 07:06:08 EDT 2013


Put single conditional statement in next line, not
with "if" or "else".

Signed-off-by: Antonio Borneo <borneo.antonio at gmail.com>
---
 cstp.c |    3 ++-
 dtls.c |    4 ++--
 tun.c  |    3 ++-
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/cstp.c b/cstp.c
index ad99657..dbe1947 100644
--- a/cstp.c
+++ b/cstp.c
@@ -119,7 +119,8 @@ static void calculate_mtu(struct openconnect_info *vpninfo, int *base_mtu, int *
 			vpn_progress(vpninfo, PRG_TRACE,
 				     _("TCP_INFO rcv mss %d, snd mss %d, adv mss %d, pmtu %d\n"),
 				     ti.tcpi_rcv_mss, ti.tcpi_snd_mss, ti.tcpi_advmss, ti.tcpi_pmtu);
-			if (!*base_mtu) *base_mtu = ti.tcpi_pmtu;
+			if (!*base_mtu)
+				*base_mtu = ti.tcpi_pmtu;
 			if (!*mtu) {
 				if (ti.tcpi_rcv_mss < ti.tcpi_snd_mss)
 					*mtu = ti.tcpi_rcv_mss - 13;
diff --git a/dtls.c b/dtls.c
index 45992b1..9a7de4c 100644
--- a/dtls.c
+++ b/dtls.c
@@ -59,7 +59,8 @@ unsigned char unhex(const char *data)
 time_t time(time_t *t)
 {
 	time_t x = 0x3ab2d948;
-	if (t) *t = x;
+	if (t)
+		*t = x;
 	return x;
 }
 
@@ -891,4 +892,3 @@ int setup_dtls(struct openconnect_info *vpninfo)
 	return -EINVAL;
 }
 #endif
-
diff --git a/tun.c b/tun.c
index 7f711a5..8f5f1b9 100644
--- a/tun.c
+++ b/tun.c
@@ -306,7 +306,8 @@ static void set_script_env(struct openconnect_info *vpninfo)
 
 	if (vpninfo->vpn_domain)
 		setenv("CISCO_DEF_DOMAIN", vpninfo->vpn_domain, 1);
-	else unsetenv ("CISCO_DEF_DOMAIN");
+	else
+		unsetenv("CISCO_DEF_DOMAIN");
 
 	if (vpninfo->vpn_proxy_pac)
 		setenv("CISCO_PROXY_PAC", vpninfo->vpn_proxy_pac, 1);
-- 
1.7.3.4




More information about the openconnect-devel mailing list