diff options
-rw-r--r-- | src/config/color.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/config/color.c b/src/config/color.c index ff0d8ca0..c386ec81 100644 --- a/src/config/color.c +++ b/src/config/color.c @@ -355,8 +355,8 @@ static int find_col(const char *col_name, int n) void color_pair_cache_reset(void) { if (cache.pairs) { - free(cache.pairs); - memset(&cache, 0, sizeof(cache)); + free(cache.pairs); + memset(&cache, 0, sizeof(cache)); } /* @@ -398,9 +398,11 @@ int color_pair_cache_get(const char *pair_name) } /* try to find pair in cache */ - for (i = 0; i < cache.size; i++) - if (fg == cache.pairs[i].fg && bg == cache.pairs[i].bg) - return i; + for (i = 0; i < cache.size; i++) { + if (fg == cache.pairs[i].fg && bg == cache.pairs[i].bg) { + return i; + } + } /* otherwise cache new pair */ |