mirror of
https://github.com/yarrick/iodine.git
synced 2024-11-24 15:21:27 +00:00
Formatting: No spaces after '(' or before ')'
This commit is contained in:
parent
15f12d0693
commit
aeacfbc2c0
|
@ -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 */
|
||||
|
|
12
src/client.c
12
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));
|
||||
|
|
|
@ -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-.])";
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue