From e9ee82e712a79decb30387905998e06296a8cea7 Mon Sep 17 00:00:00 2001 From: jvech Date: Sun, 25 Jun 2023 08:59:31 -0500 Subject: fix: small segmentation fault bug fixed --- src/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index a1b79f3..74cdef9 100644 --- a/src/main.c +++ b/src/main.c @@ -193,7 +193,8 @@ int main(int argc, char *argv[]) }; float *kernel = NULL; - if (!strcmp(filter, "edge")) kernel = edge; + if (!filter) usage(); + else if (!strcmp(filter, "edge")) kernel = edge; else if (!strcmp(filter, "blur")) kernel = blur; else if (!strcmp(filter, "sharpen")) kernel = sharpen; else usage(); -- cgit v1.2.3-70-g09d2