mirror of
https://github.com/dankamongmen/notcurses.git
synced 2024-11-20 03:25:47 +00:00
term_esc_rgb: add some assert()s
This commit is contained in:
parent
d3d9d41fd9
commit
a3fbd9ae84
@ -601,6 +601,9 @@ static const char* NUMBERS[] = {
|
|||||||
|
|
||||||
static inline int
|
static inline int
|
||||||
term_esc_rgb(FILE* out, bool foreground, unsigned r, unsigned g, unsigned b){
|
term_esc_rgb(FILE* out, bool foreground, unsigned r, unsigned g, unsigned b){
|
||||||
|
assert(r < 256);
|
||||||
|
assert(g < 256);
|
||||||
|
assert(b < 256);
|
||||||
// The correct way to do this is using tiparm+tputs, but doing so (at least
|
// The correct way to do this is using tiparm+tputs, but doing so (at least
|
||||||
// as of terminfo 6.1.20191019) both emits ~3% more bytes for a run of 'rgb'
|
// as of terminfo 6.1.20191019) both emits ~3% more bytes for a run of 'rgb'
|
||||||
// and gives rise to some corrupted cells (possibly due to special handling of
|
// and gives rise to some corrupted cells (possibly due to special handling of
|
||||||
|
Loading…
Reference in New Issue
Block a user