From 1e78526693d22abe24c98291a782998573f6b01d Mon Sep 17 00:00:00 2001 From: Alice Frosi Date: Wed, 17 May 2023 13:20:13 +0200 Subject: Minor fixes for the filter and the eater Add: - ignore_args field for the filter. - use MAX_FILTER to define the filter size in the eater --- eater/Makefile | 5 +++-- eater/eater.c | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'eater') diff --git a/eater/Makefile b/eater/Makefile index 2e08b1f..1f85126 100644 --- a/eater/Makefile +++ b/eater/Makefile @@ -8,10 +8,11 @@ # Author: Alice Frosi COMMON_DIR :=../common +COOKER_DIR := ../cooker SRCS := $(COMMON_DIR)/common.c eater.c -HEADERS := $(COMMON_DIR)/common.h +HEADERS := $(COMMON_DIR)/common.h $(COOKER_DIR)/filter.h BIN := $(OUTDIR)/seitan-eater -CFLAGS += -Wall -Wextra -pedantic -I$(COMMON_DIR) +CFLAGS += -Wall -Wextra -pedantic -I$(COMMON_DIR) -I$(COOKER_DIR) eater: $(SRCS) $(HEADERS) $(CC) $(CFLAGS) -o $(BIN) $(SRCS) diff --git a/eater/eater.c b/eater/eater.c index 0236637..2169eb6 100644 --- a/eater/eater.c +++ b/eater/eater.c @@ -23,6 +23,8 @@ #include #include "common.h" +#include "filter.h" + static struct option options[] = { { "input", required_argument, NULL, 'i' }, { 0, 0, 0, 0 }, @@ -85,7 +87,7 @@ static void signal_handler(__attribute__((unused)) int s) */ int main(int argc, char **argv) { - struct sock_filter filter[1024]; + struct sock_filter filter[MAX_FILTER]; struct arguments arguments; struct sigaction act; int fd, flags; -- cgit v1.2.3