From 98cb2de85018ea16dfb8f6a6a8797bbb74bc336d Mon Sep 17 00:00:00 2001 From: nick black Date: Fri, 14 Aug 2020 04:33:22 -0400 Subject: [PATCH] pool_egc_copy: beat the stupid out with a broom --- src/lib/render.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/lib/render.c b/src/lib/render.c index 8ff4f88d7..04db24b34 100644 --- a/src/lib/render.c +++ b/src/lib/render.c @@ -1074,16 +1074,10 @@ int notcurses_render(notcurses* nc){ // result is not tied to the ncplane, and persists across erases / destruction. static inline char* pool_egc_copy(const egcpool* e, const cell* c){ - char* ret; if(cell_simple_p(c)){ - if( (ret = (char*)malloc(sizeof(c->gcluster) + 1)) ){ - memset(ret, 0, sizeof(c->gcluster) + 1); - memcpy(ret, &c->gcluster, sizeof(c->gcluster)); - } - }else{ - ret = strdup(egcpool_extended_gcluster(e, c)); + return strdup((const char*)&c->gcluster); } - return ret; + return strdup(egcpool_extended_gcluster(e, c)); } char* notcurses_at_yx(notcurses* nc, int yoff, int xoff, uint32_t* attrword, uint64_t* channels){