mirror of
https://github.com/yarrick/iodine.git
synced 2025-10-17 16:51:54 +00:00
Remove trailing whitespace
This commit is contained in:
18
src/common.c
18
src/common.c
@@ -61,7 +61,7 @@ const unsigned char raw_header[RAW_HDR_LEN] = { 0x10, 0xd1, 0x9e, 0x00 };
|
||||
static int daemon(int nochdir, int noclose)
|
||||
{
|
||||
int fd, i;
|
||||
|
||||
|
||||
switch (fork()) {
|
||||
case 0:
|
||||
break;
|
||||
@@ -70,15 +70,15 @@ static int daemon(int nochdir, int noclose)
|
||||
default:
|
||||
_exit(0);
|
||||
}
|
||||
|
||||
|
||||
if (!nochdir) {
|
||||
chdir("/");
|
||||
}
|
||||
|
||||
|
||||
if (setsid() < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
if (!noclose) {
|
||||
if ((fd = open("/dev/null", O_RDWR)) >= 0) {
|
||||
for (i = 0; i < 3; i++) {
|
||||
@@ -170,7 +170,7 @@ get_addr(char *host, int port, int addr_family, int flags, struct sockaddr_stora
|
||||
return res;
|
||||
}
|
||||
|
||||
int
|
||||
int
|
||||
open_dns(struct sockaddr_storage *sockaddr, size_t sockaddr_len)
|
||||
{
|
||||
int flag = 1;
|
||||
@@ -291,7 +291,7 @@ read_password(char *buf, size_t len)
|
||||
|
||||
tcgetattr(0, &tp);
|
||||
old = tp;
|
||||
|
||||
|
||||
tp.c_lflag &= (~ECHO);
|
||||
tcsetattr(0, TCSANOW, &tp);
|
||||
#else
|
||||
@@ -317,7 +317,7 @@ read_password(char *buf, size_t len)
|
||||
fprintf(stderr, "\n");
|
||||
|
||||
#ifndef WINDOWS32
|
||||
tcsetattr(0, TCSANOW, &old);
|
||||
tcsetattr(0, TCSANOW, &old);
|
||||
#endif
|
||||
|
||||
strncpy(buf, pwd, len);
|
||||
@@ -360,7 +360,7 @@ check_topdomain(char *str, char **errormsg)
|
||||
} else {
|
||||
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] == '.' ) {
|
||||
continue;
|
||||
} else {
|
||||
@@ -404,7 +404,7 @@ warn(const char *fmt, ...)
|
||||
if (fmt) fprintf(stderr, fmt, list);
|
||||
#ifndef ANDROID
|
||||
if (errno == 0) {
|
||||
fprintf(stderr, ": WSA error %d\n", WSAGetLastError());
|
||||
fprintf(stderr, ": WSA error %d\n", WSAGetLastError());
|
||||
} else {
|
||||
fprintf(stderr, ": %s\n", strerror(errno));
|
||||
}
|
||||
|
Reference in New Issue
Block a user