about summary refs log tree commit diff stats
path: root/src/config/color.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/config/color.c')
-rw-r--r--src/config/color.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/config/color.c b/src/config/color.c
index d80b2b36..b5df3d2f 100644
--- a/src/config/color.c
+++ b/src/config/color.c
@@ -365,6 +365,11 @@ void color_pair_cache_reset(void)
      * compile-time constant
      */
     cache.capacity = COLOR_PAIRS;
+
+    /* when we run unit tests COLOR_PAIRS will be -1 */
+    if (cache.capacity < 0)
+        cache.capacity = 8;
+
     cache.pairs = g_malloc0(sizeof(*cache.pairs)*cache.capacity);
 
     /* default_default */