diff options
author | John Ankarström <john@ankarstrom.se> | 2019-01-10 18:06:56 +0100 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2019-01-10 18:06:56 +0100 |
commit | 9ded858901e27d1fe7360e2719cc2e4c5d8aa966 (patch) | |
tree | e1884e6a51e50a70e370e24190c4d24f76b4ebf7 | |
parent | ebba43d156b6feb0fb845c603b1de1ea930ecd4e (diff) | |
download | repl-9ded858901e27d1fe7360e2719cc2e4c5d8aa966.tar.gz |
zeroed struct
-rw-r--r-- | Makefile | 1 | ||||
-rw-r--r-- | repl.c | 4 |
2 files changed, 2 insertions, 3 deletions
@@ -1,6 +1,5 @@ PREFIX = /usr/local -CFLAGS = -Werror -Wall LDFLAGS = -lreadline -ltermcap repl: repl.c @@ -6,7 +6,7 @@ #include <readline/readline.h> #include <readline/history.h> -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); |