diff --git a/src/bin/unicodeblocks.c b/src/bin/unicodeblocks.c index 40d781684..0a2c197c0 100644 --- a/src/bin/unicodeblocks.c +++ b/src/bin/unicodeblocks.c @@ -112,9 +112,9 @@ int unicodeblocks_demo(struct notcurses* nc){ } } cell_release(n, &c); - if(notcurses_render(nc)){ - return -1; - } + } + if(notcurses_render(nc)){ + return -1; } usleep(10000); // for a 32-bit wchar_t, we would want up through 24 bits of block ID. but diff --git a/src/lib/notcurses.c b/src/lib/notcurses.c index 9091aaba7..f66bfd3c0 100644 --- a/src/lib/notcurses.c +++ b/src/lib/notcurses.c @@ -576,7 +576,7 @@ int notcurses_render(notcurses* nc){ int y, x; char* buf = NULL; size_t buflen = 0; - FILE* out = open_memstream(&buf, &buflen); + FILE* out = open_memstream(&buf, &buflen); // worth keeping around? if(out == NULL){ return -1; } @@ -600,7 +600,7 @@ int notcurses_render(notcurses* nc){ } } ret |= fclose(out); - printf("%.*s", (int)buflen, buf); + printf("%s", buf); clock_gettime(CLOCK_MONOTONIC, &done); free(buf); update_render_stats(&done, &start, &nc->stats);