diff --git a/ChangeLog b/ChangeLog
index 439a309529175d61eaf05086394c22899654aba2..f5cc9860824f52be35eaccb15e841a1f19e890b3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2007-12-10  David Lawrence Ramsey  <pooka109@gmail.com>
+
+	* nano.c (main): Exit if initscr() fails.
+
 2007-12-09  David Lawrence Ramsey  <pooka109@gmail.com>
 
 	* faq.html: Add minor punctuation and wording fixes, and update
diff --git a/src/nano.c b/src/nano.c
index 483ee44933ec60fa1eb28f877ce6946005cb01b0..37a78dffea7498101f6e421a11a328bd1734babc 100644
--- a/src/nano.c
+++ b/src/nano.c
@@ -2038,7 +2038,7 @@ int main(int argc, char **argv)
 	    free(backup_dir);
 	    backup_dir = backup_dir_cpy;
 	}
-#endif	
+#endif
 #ifndef DISABLE_JUSTIFY
 	if (quotestr_cpy != NULL) {
 	    free(quotestr);
@@ -2164,8 +2164,9 @@ int main(int argc, char **argv)
     /* Back up the old terminal settings so that they can be restored. */
     tcgetattr(0, &oldterm);
 
-    /* Initialize curses mode. */
-    initscr();
+    /* Initialize curses mode.  If this fails, get out. */
+    if (initscr() == NULL)
+	exit(1);
 
     /* Set up the terminal state. */
     terminal_init();