diff --git a/src/lib/internal.h b/src/lib/internal.h index d06d43730..ee4306bbe 100644 --- a/src/lib/internal.h +++ b/src/lib/internal.h @@ -899,8 +899,8 @@ pool_load_direct(egcpool* pool, cell* c, const char* gcluster, int bytes, int co assert(cols < 2); pool_release(pool, c); c->channels &= ~(CELL_WIDEASIAN_MASK | CELL_NOBACKGROUND_MASK); + c->gcluster = 0; ((unsigned char*)&c->gcluster)[0] = *gcluster; - ((unsigned char*)&c->gcluster)[1] = 0; return bytes; } // FIXME also shaded blocks! ░ etc. are there combined EGCs involving these? diff --git a/tests/palette.cpp b/tests/palette.cpp index 224773c13..85995f3a4 100644 --- a/tests/palette.cpp +++ b/tests/palette.cpp @@ -64,10 +64,10 @@ TEST_CASE("Palette256") { // write it to an ncplane, and verify attributes via reflection SUBCASE("PutCAttrs") { cell c = CELL_TRIVIAL_INITIALIZER; - cell_load_simple(n_, &c, 'X'); + CHECK(1 == cell_load_simple(n_, &c, 'X')); CHECK(0 == cell_set_fg_palindex(&c, 0x20)); CHECK(0 == cell_set_bg_palindex(&c, 0x40)); - CHECK(0 < ncplane_putc_yx(n_, 0, 0, &c)); + CHECK(1 == ncplane_putc_yx(n_, 0, 0, &c)); cell_release(n_, &c); cell r = CELL_TRIVIAL_INITIALIZER; CHECK(0 < ncplane_at_yx_cell(n_, 0, 0, &r));