diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/curses/gui-curses-color.c | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/src/gui/curses/gui-curses-color.c b/src/gui/curses/gui-curses-color.c index 6347f1633..00c8e7133 100644 --- a/src/gui/curses/gui-curses-color.c +++ b/src/gui/curses/gui-curses-color.c @@ -523,16 +523,14 @@ gui_color_init_vars () gui_color_num_pairs = (gui_color_term_color_pairs >= 256) ? 255 : gui_color_term_color_pairs - 1; - if (gui_color_term_colors > 0) - { - size = (gui_color_term_colors + 2) - * (gui_color_term_colors + 2) - * sizeof (gui_color_pairs[0]); - gui_color_pairs = malloc (size); - if (gui_color_pairs) - memset (gui_color_pairs, 0, size); - gui_color_pairs_used = 0; - } + size = (gui_color_term_colors + 2) + * (gui_color_term_colors + 2) + * sizeof (gui_color_pairs[0]); + gui_color_pairs = malloc (size); + if (gui_color_pairs) + memset (gui_color_pairs, 0, size); + gui_color_pairs_used = 0; + /* reserved for future usage */ /* gui_color_term_color_content = malloc (sizeof (gui_color_term_color_content[0]) * @@ -549,6 +547,18 @@ gui_color_init_vars () } */ } + else + { + gui_color_term_colors = 1; + gui_color_term_color_pairs = 1; + gui_color_term_can_change_color = 0; + gui_color_num_pairs = 1; + size = sizeof (gui_color_pairs[0]); + gui_color_pairs = malloc (size); + if (gui_color_pairs) + memset (gui_color_pairs, 0, size); + gui_color_pairs_used = 0; + } } /* |