remove redundant else and fix formatting
This commit is contained in:
parent
c6ed6a3b25
commit
743cac974d
24
fbflut.c
24
fbflut.c
|
@ -22,8 +22,8 @@
|
|||
#include <sys/prctl.h>
|
||||
#include <sys/syscall.h>
|
||||
|
||||
#define ALLOW(syscall) \
|
||||
BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, SYS_##syscall, 0, 1), \
|
||||
#define ALLOW(syscall) \
|
||||
BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, SYS_##syscall, 0, 1), \
|
||||
BPF_STMT(BPF_RET + BPF_K, SECCOMP_RET_ALLOW)
|
||||
|
||||
static int setup_seccomp() {
|
||||
|
@ -113,18 +113,16 @@ void *handle_connection(void *socket_desc) {
|
|||
if (read_size == 36) {
|
||||
/* line too long, attempt parsing anyways */
|
||||
read_to = (uintptr_t)client_message + read_size;
|
||||
} else {
|
||||
/* line partially read, try reading more */
|
||||
read_size = recv(sock, client_message, 36,
|
||||
MSG_PEEK
|
||||
#ifndef LOSSY
|
||||
| MSG_WAITALL
|
||||
#endif
|
||||
);
|
||||
client_message[read_size] = '\0';
|
||||
read_to =
|
||||
(uintptr_t)strchrnul(client_message, '\n');
|
||||
}
|
||||
/* line partially read, try reading more */
|
||||
read_size = recv(sock, client_message, 36,
|
||||
MSG_PEEK
|
||||
#ifndef LOSSY
|
||||
| MSG_WAITALL
|
||||
#endif
|
||||
);
|
||||
client_message[read_size] = '\0';
|
||||
read_to = (uintptr_t)strchrnul(client_message, '\n');
|
||||
}
|
||||
read_to = read_to - (uintptr_t)client_message;
|
||||
read_size = recv(sock, client_message, read_to + 1, 0);
|
||||
|
|
Loading…
Reference in New Issue