From 743cac974d11b0c39bf3b5f1a70174aa2250d403 Mon Sep 17 00:00:00 2001 From: xfnw Date: Mon, 8 Jan 2024 13:12:42 -0500 Subject: [PATCH] remove redundant else and fix formatting --- fbflut.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/fbflut.c b/fbflut.c index 1dfc41f..8b53f09 100644 --- a/fbflut.c +++ b/fbflut.c @@ -22,8 +22,8 @@ #include #include -#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);