From 9ded858901e27d1fe7360e2719cc2e4c5d8aa966 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Thu, 10 Jan 2019 18:06:56 +0100 Subject: zeroed struct --- Makefile | 1 - repl.c | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index f6f512d..d80a3c0 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,5 @@ PREFIX = /usr/local -CFLAGS = -Werror -Wall LDFLAGS = -lreadline -ltermcap repl: repl.c diff --git a/repl.c b/repl.c index 1fcca4a..9991338 100644 --- a/repl.c +++ b/repl.c @@ -6,7 +6,7 @@ #include #include -void handle_int(int sig) { /* handle ctrl-c */ +void handle_int() { /* handle ctrl-c */ printf("\n"); rl_on_new_line(); rl_replace_line("", 0); @@ -24,7 +24,7 @@ int main(int argc, char *argv[]) { if (prompt == NULL) err(1, NULL); snprintf(prompt, size, "%s > ", argv[1]); - struct sigaction act; + struct sigaction act = {0}; act.sa_handler = handle_int; sigaction(SIGINT, &act, NULL); -- cgit v1.2.3