Fix #34: Exit if screen is wider than 255 instead of giving width of zero.
authorDavid Griffith <dave@661.org>
Tue, 10 Jan 2017 12:45:21 +0000 (04:45 -0800)
committerDavid Griffith <dave@661.org>
Tue, 10 Jan 2017 12:45:21 +0000 (04:45 -0800)
src/curses/ux_init.c

index 257b5475122d50e12002a137496cf6842a8add89..8d564d1a341cc848695b04c23dc95244a40ca215 100644 (file)
@@ -442,6 +442,9 @@ void os_init_screen (void)
     h_screen_width = h_screen_cols;
     h_screen_height = h_screen_rows;
 
+    if (h_screen_width > 255 || h_screen_width < 1)
+       os_fatal("Invalid screen width. Must be between 1 and 255.");
+
     h_font_width = 1;
     h_font_height = 1;