aboutsummaryrefslogtreecommitdiff
path: root/joshua.c
diff options
context:
space:
mode:
authorFranklin Wei <frankhwei536@gmail.com>2014-06-23 15:08:58 -0400
committerFranklin Wei <frankhwei536@gmail.com>2014-06-23 15:08:58 -0400
commitb4f84e24ff5a33b22fcdeeec2f7180248e535e52 (patch)
treef63caa643dae391b8c6f9359709e0329eda41f52 /joshua.c
parentfb1871333736e17196ee0bb72a7dc86aabfd55f4 (diff)
downloadwargames-server-b4f84e24ff5a33b22fcdeeec2f7180248e535e52.zip
wargames-server-b4f84e24ff5a33b22fcdeeec2f7180248e535e52.tar.gz
wargames-server-b4f84e24ff5a33b22fcdeeec2f7180248e535e52.tar.bz2
wargames-server-b4f84e24ff5a33b22fcdeeec2f7180248e535e52.tar.xz
Cleaned up code, fixed some bugs
Diffstat (limited to 'joshua.c')
-rw-r--r--joshua.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/joshua.c b/joshua.c
index f225ec9..5b5f27a 100644
--- a/joshua.c
+++ b/joshua.c
@@ -3,7 +3,13 @@
#include <curses.h>
#include <stdlib.h>
#include <util.h>
+#include <signal.h>
#define RANDOM_TIME 1
+void cleanup(int signum)
+{
+ endwin();
+ exit(0);
+}
void random_stuff(void) /* print random junk on the screen for about 3 seconds */
{
clear();
@@ -19,6 +25,7 @@ void be_joshua()
{
initscr();
clear();
+ signal(SIGINT, &cleanup);
/*
start_color();
init_pair(1, COLOR_BLUE, COLOR_BLACK);