mirror of
https://github.com/profanity-im/profanity.git
synced 2025-01-03 14:57:42 -05:00
color: set capacity in unittest case
Fix https://github.com/profanity-im/profanity/issues/1178
This commit is contained in:
parent
bad244fc95
commit
e408e988a7
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user