From f339855c395159ec33fcf35cc224a1e1728b475f Mon Sep 17 00:00:00 2001 From: nick black Date: Tue, 6 Jul 2021 21:06:15 -0400 Subject: [PATCH] nccell_width: minimum width is 1 #1894 --- src/lib/notcurses.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/notcurses.c b/src/lib/notcurses.c index 045768c34..c3ab31dce 100644 --- a/src/lib/notcurses.c +++ b/src/lib/notcurses.c @@ -1524,7 +1524,7 @@ void scroll_down(ncplane* n){ } int nccell_width(const ncplane* n __attribute__ ((unused)), const nccell* c){ - return c->width; + return c->width ? c->width : 1; } int nccell_load(ncplane* n, nccell* c, const char* gcluster){ @@ -1620,7 +1620,7 @@ ncplane_put(ncplane* n, int y, int x, const char* egc, int cols, } int ncplane_putc_yx(ncplane* n, int y, int x, const nccell* c){ - const int cols = c->width; + const int cols = nccell_width(n, c); const char* egc = nccell_extended_gcluster(n, c); return ncplane_put(n, y, x, egc, cols, c->stylemask, c->channels, strlen(egc)); }