aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/main.c b/src/main.c
index c3c4a70..41aa920 100644
--- a/src/main.c
+++ b/src/main.c
@@ -13,15 +13,19 @@ int main(int argc, char *argv[])
curl_global_init(CURL_GLOBAL_DEFAULT);
- atexit(cleanup);
-
initscr();
echo();
nocbreak();
nl();
scrollok(stdscr, true);
- atexit(endwin);
+ atexit(cleanup);
+
+ const struct sigaction handler = {
+ .sa_handler = sig_handler
+ };
+
+ sigaction(SIGINT, &handler, NULL);
struct player_t *player = malloc(sizeof(struct player_t));
memset(player, 0, sizeof(struct player_t));