From aeacfbc2c08d7275b8ee8149fc05cb8735de6be5 Mon Sep 17 00:00:00 2001 From: Erik Ekman Date: Fri, 24 Jul 2020 19:02:41 +0200 Subject: [PATCH] Formatting: No spaces after '(' or before ')' --- src/base64.c | 2 +- src/client.c | 12 ++++++------ src/common.c | 2 +- src/iodined.c | 9 +++++---- src/tun.c | 4 ++-- 5 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/base64.c b/src/base64.c index 2a80abe..04cfb8d 100644 --- a/src/base64.c +++ b/src/base64.c @@ -85,7 +85,7 @@ static int base64_encode(char *buf, size_t *buflen, const void *data, if (iout >= *buflen || iin >= size) break; - buf[iout] = cb64[((udata[iin] & 0x0f) << 2 ) | + buf[iout] = cb64[((udata[iin] & 0x0f) << 2) | ((iin + 1 < size) ? ((udata[iin + 1] & 0xc0) >> 6) : 0)]; iin++; /* 1 complete, iin=2 */ diff --git a/src/client.c b/src/client.c index a91950b..2880e1b 100644 --- a/src/client.c +++ b/src/client.c @@ -1263,7 +1263,7 @@ send_ip_request(int fd, int userid) buf[2] = b32_5to8((rand_seed >> 10) & 0x1f); buf[3] = b32_5to8((rand_seed >> 5) & 0x1f); - buf[4] = b32_5to8((rand_seed ) & 0x1f); + buf[4] = b32_5to8((rand_seed) & 0x1f); rand_seed++; strncat(buf, topdomain, 512 - strlen(buf)); @@ -1287,7 +1287,7 @@ send_upenctest(int fd, const char *s) buf[1] = b32_5to8((rand_seed >> 10) & 0x1f); buf[2] = b32_5to8((rand_seed >> 5) & 0x1f); - buf[3] = b32_5to8((rand_seed ) & 0x1f); + buf[3] = b32_5to8((rand_seed) & 0x1f); rand_seed++; strncat(buf, s, 128); @@ -1307,7 +1307,7 @@ send_downenctest(int fd, char downenc, int variant, char *s, int slen) buf[3] = b32_5to8((rand_seed >> 10) & 0x1f); buf[4] = b32_5to8((rand_seed >> 5) & 0x1f); - buf[5] = b32_5to8((rand_seed ) & 0x1f); + buf[5] = b32_5to8((rand_seed) & 0x1f); rand_seed++; strncat(buf, topdomain, 512 - strlen(buf)); @@ -1323,7 +1323,7 @@ send_codec_switch(int fd, int userid, int bits) buf[3] = b32_5to8((rand_seed >> 10) & 0x1f); buf[4] = b32_5to8((rand_seed >> 5) & 0x1f); - buf[5] = b32_5to8((rand_seed ) & 0x1f); + buf[5] = b32_5to8((rand_seed) & 0x1f); rand_seed++; strncat(buf, topdomain, 512 - strlen(buf)); @@ -1340,7 +1340,7 @@ send_downenc_switch(int fd, int userid) buf[3] = b32_5to8((rand_seed >> 10) & 0x1f); buf[4] = b32_5to8((rand_seed >> 5) & 0x1f); - buf[5] = b32_5to8((rand_seed ) & 0x1f); + buf[5] = b32_5to8((rand_seed) & 0x1f); rand_seed++; strncat(buf, topdomain, 512 - strlen(buf)); @@ -1360,7 +1360,7 @@ send_lazy_switch(int fd, int userid) buf[3] = b32_5to8((rand_seed >> 10) & 0x1f); buf[4] = b32_5to8((rand_seed >> 5) & 0x1f); - buf[5] = b32_5to8((rand_seed ) & 0x1f); + buf[5] = b32_5to8((rand_seed) & 0x1f); rand_seed++; strncat(buf, topdomain, 512 - strlen(buf)); diff --git a/src/common.c b/src/common.c index 957fb7a..d63ebd2 100644 --- a/src/common.c +++ b/src/common.c @@ -368,7 +368,7 @@ check_topdomain(char *str, char **errormsg) chunklen++; } if ((str[i] >= 'a' && str[i] <= 'z') || (str[i] >= 'A' && str[i] <= 'Z') || - isdigit(str[i]) || str[i] == '-' || str[i] == '.' ) { + isdigit(str[i]) || str[i] == '-' || str[i] == '.') { continue; } else { if (errormsg) *errormsg = "Contains illegal character (allowed: [a-zA-Z0-9-.])"; diff --git a/src/iodined.c b/src/iodined.c index 9bf8bd3..7e30c70 100644 --- a/src/iodined.c +++ b/src/iodined.c @@ -203,7 +203,7 @@ static int check_user_and_ip(int userid, struct query *q) { /* Note: duplicate in handle_raw_login() except IP-address check */ - if (userid < 0 || userid >= created_users ) { + if (userid < 0 || userid >= created_users) { return 1; } if (!users[userid].active || users[userid].disabled) { @@ -1833,11 +1833,12 @@ tunnel(int tun_fd, struct dnsfd *dns_fds, int bind_fd, int max_idle_time) if (i==0) { if (max_idle_time) { - /* only trigger the check if that's worth ( ie, no need to loop over if there + /* only trigger the check if that's worth (ie, no need to loop over if there is something to send */ if (last_action + max_idle_time < time(NULL)) { for (userid = 0; userid < created_users; userid++) { - last_action = ( users[userid].last_pkt > last_action ) ? users[userid].last_pkt : last_action; + last_action = (users[userid].last_pkt > last_action) ? + users[userid].last_pkt : last_action; } if (last_action + max_idle_time < time(NULL)) { fprintf(stderr, "Idling since too long, shutting down...\n"); @@ -2744,7 +2745,7 @@ main(int argc, char **argv) tzsetwall(); #endif #ifndef WINDOWS32 - openlog( __progname, LOG_NDELAY, LOG_DAEMON ); + openlog(__progname, LOG_NDELAY, LOG_DAEMON); #endif if (newroot != NULL) diff --git a/src/tun.c b/src/tun.c index bee1663..05f18ad 100644 --- a/src/tun.c +++ b/src/tun.c @@ -155,7 +155,7 @@ get_device(char *device, int device_len, const char *wanted_dev) status = RegOpenKeyEx(HKEY_LOCAL_MACHINE, TAP_ADAPTER_KEY, 0, KEY_READ, &adapter_key); if (status != ERROR_SUCCESS) { - warnx("Error opening registry key " TAP_ADAPTER_KEY ); + warnx("Error opening registry key " TAP_ADAPTER_KEY); return; } @@ -175,7 +175,7 @@ get_device(char *device, int device_len, const char *wanted_dev) if (status == ERROR_NO_MORE_ITEMS) { break; } else if (status != ERROR_SUCCESS) { - warnx("Error enumerating subkeys of registry key " TAP_ADAPTER_KEY ); + warnx("Error enumerating subkeys of registry key " TAP_ADAPTER_KEY); break; }