From 2ceb2f50975c1c475bb64c45453ff47273666b42 Mon Sep 17 00:00:00 2001 From: nick black Date: Fri, 14 Aug 2020 04:57:53 -0400 Subject: [PATCH] egcpool_extended_gcluster: assert() for great justice --- src/lib/egcpool.h | 1 + src/lib/render.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib/egcpool.h b/src/lib/egcpool.h index ffc6928a4..429503d15 100644 --- a/src/lib/egcpool.h +++ b/src/lib/egcpool.h @@ -255,6 +255,7 @@ cell_egc_idx(const cell* c){ // only applies to complex cells, do not use on simple cells __attribute__ ((__returns_nonnull__)) static inline const char* egcpool_extended_gcluster(const egcpool* pool, const cell* c) { + assert(!cell_simple_p(c)); uint32_t idx = cell_egc_idx(c); return pool->pool + idx; } diff --git a/src/lib/render.c b/src/lib/render.c index a0f8937ae..26c914ee0 100644 --- a/src/lib/render.c +++ b/src/lib/render.c @@ -606,8 +606,8 @@ term_esc_rgb(FILE* out, bool foreground, unsigned r, unsigned g, unsigned b){ assert(b < 256); // 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' - // and gives rise to some corrupted cells (possibly due to special handling of - // values < 256; I'm not at this time sure). So we just cons up our own. + // and gives rise to some inaccurate colors (possibly due to special handling + // of values < 256; I'm not at this time sure). So we just cons up our own. /*if(esc == 4){ return term_emit("setab", tiparm(nc->setab, (int)((r << 16u) | (g << 8u) | b)), out, false); }else if(esc == 3){