diff --git a/src/lib/notcurses.c b/src/lib/notcurses.c index ee636ace0..43ef13dd6 100644 --- a/src/lib/notcurses.c +++ b/src/lib/notcurses.c @@ -1312,21 +1312,19 @@ int ncplane_putc_yx(ncplane* n, int y, int x, const cell* c){ static inline int cell_load_direct(ncplane* n, cell* c, const char* gcluster, int bytes, int cols){ - if(bytes >= 0 && cols >= 0 && bytes <= 1){ + if(bytes < 0 || cols < 0){ + return -1; + } + if(bytes <= 1){ cell_release(n, c); c->channels &= ~CELL_WIDEASIAN_MASK; c->gcluster = *gcluster; - return !!c->gcluster; - } - if(bytes < 0){ - return -1; + return bytes; } if(cols > 1){ c->channels |= CELL_WIDEASIAN_MASK; - }else if(cols >= 0){ - c->channels &= ~CELL_WIDEASIAN_MASK; }else{ - return -1; + c->channels &= ~CELL_WIDEASIAN_MASK; } if(!cell_simple_p(c)){ if(strcmp(gcluster, cell_extended_gcluster(n, c)) == 0){