1
0
mirror of https://github.com/yarrick/iodine.git synced 2024-11-25 22:46:05 +03:00

Formatting: No spaces after '(' or before ')'

This commit is contained in:
Erik Ekman 2020-07-24 19:02:41 +02:00
parent 15f12d0693
commit aeacfbc2c0
5 changed files with 15 additions and 14 deletions

View File

@ -85,7 +85,7 @@ static int base64_encode(char *buf, size_t *buflen, const void *data,
if (iout >= *buflen || iin >= size) if (iout >= *buflen || iin >= size)
break; break;
buf[iout] = cb64[((udata[iin] & 0x0f) << 2 ) | buf[iout] = cb64[((udata[iin] & 0x0f) << 2) |
((iin + 1 < size) ? ((iin + 1 < size) ?
((udata[iin + 1] & 0xc0) >> 6) : 0)]; ((udata[iin + 1] & 0xc0) >> 6) : 0)];
iin++; /* 1 complete, iin=2 */ iin++; /* 1 complete, iin=2 */

View File

@ -1263,7 +1263,7 @@ send_ip_request(int fd, int userid)
buf[2] = b32_5to8((rand_seed >> 10) & 0x1f); buf[2] = b32_5to8((rand_seed >> 10) & 0x1f);
buf[3] = b32_5to8((rand_seed >> 5) & 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++; rand_seed++;
strncat(buf, topdomain, 512 - strlen(buf)); 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[1] = b32_5to8((rand_seed >> 10) & 0x1f);
buf[2] = b32_5to8((rand_seed >> 5) & 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++; rand_seed++;
strncat(buf, s, 128); 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[3] = b32_5to8((rand_seed >> 10) & 0x1f);
buf[4] = b32_5to8((rand_seed >> 5) & 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++; rand_seed++;
strncat(buf, topdomain, 512 - strlen(buf)); 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[3] = b32_5to8((rand_seed >> 10) & 0x1f);
buf[4] = b32_5to8((rand_seed >> 5) & 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++; rand_seed++;
strncat(buf, topdomain, 512 - strlen(buf)); 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[3] = b32_5to8((rand_seed >> 10) & 0x1f);
buf[4] = b32_5to8((rand_seed >> 5) & 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++; rand_seed++;
strncat(buf, topdomain, 512 - strlen(buf)); 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[3] = b32_5to8((rand_seed >> 10) & 0x1f);
buf[4] = b32_5to8((rand_seed >> 5) & 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++; rand_seed++;
strncat(buf, topdomain, 512 - strlen(buf)); strncat(buf, topdomain, 512 - strlen(buf));

View File

@ -368,7 +368,7 @@ check_topdomain(char *str, char **errormsg)
chunklen++; chunklen++;
} }
if ((str[i] >= 'a' && str[i] <= 'z') || (str[i] >= 'A' && str[i] <= 'Z') || 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; continue;
} else { } else {
if (errormsg) *errormsg = "Contains illegal character (allowed: [a-zA-Z0-9-.])"; if (errormsg) *errormsg = "Contains illegal character (allowed: [a-zA-Z0-9-.])";

View File

@ -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 */ /* Note: duplicate in handle_raw_login() except IP-address check */
if (userid < 0 || userid >= created_users ) { if (userid < 0 || userid >= created_users) {
return 1; return 1;
} }
if (!users[userid].active || users[userid].disabled) { 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 (i==0) {
if (max_idle_time) { 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 */ is something to send */
if (last_action + max_idle_time < time(NULL)) { if (last_action + max_idle_time < time(NULL)) {
for (userid = 0; userid < created_users; userid++) { 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)) { if (last_action + max_idle_time < time(NULL)) {
fprintf(stderr, "Idling since too long, shutting down...\n"); fprintf(stderr, "Idling since too long, shutting down...\n");
@ -2744,7 +2745,7 @@ main(int argc, char **argv)
tzsetwall(); tzsetwall();
#endif #endif
#ifndef WINDOWS32 #ifndef WINDOWS32
openlog( __progname, LOG_NDELAY, LOG_DAEMON ); openlog(__progname, LOG_NDELAY, LOG_DAEMON);
#endif #endif
if (newroot != NULL) if (newroot != NULL)

View File

@ -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); status = RegOpenKeyEx(HKEY_LOCAL_MACHINE, TAP_ADAPTER_KEY, 0, KEY_READ, &adapter_key);
if (status != ERROR_SUCCESS) { if (status != ERROR_SUCCESS) {
warnx("Error opening registry key " TAP_ADAPTER_KEY ); warnx("Error opening registry key " TAP_ADAPTER_KEY);
return; return;
} }
@ -175,7 +175,7 @@ get_device(char *device, int device_len, const char *wanted_dev)
if (status == ERROR_NO_MORE_ITEMS) { if (status == ERROR_NO_MORE_ITEMS) {
break; break;
} else if (status != ERROR_SUCCESS) { } 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; break;
} }