Skip to content

Commit

Permalink
use typed var
Browse files Browse the repository at this point in the history
since short is what is used for storing color pairs, calling pair_content
with anything else should be undefined behaviour,
thus, only initializing up to color_pairs_max should be acceptable

I think this makes a little more sense then using the defined constants
  • Loading branch information
shua committed Mar 30, 2018
1 parent 2344962 commit 311a8c0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1833,7 +1833,7 @@ static void init_colors(void)
* 0 and 0. Initialize all color-pairs in order to have consistent
* behaviour despite the implementation used.
*/
for (short i = 1; i < MIN(COLOR_PAIRS, SHRT_MAX); i++)
for (short i = 1; i < color_pairs_max; i++)
init_pair(i, 0, 0);
vt_color_reserve(COLOR_WHITE, COLOR_BLACK);
}
Expand Down

0 comments on commit 311a8c0

Please sign in to comment.