zoo demo: feed ncplane_puttext() atomic words #897

This commit is contained in:
nick black 2020-08-16 18:23:10 -04:00
parent 1a0d28d8d0
commit 6d62470032
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

View File

@ -320,15 +320,11 @@ reader_thread(void* vmarsh){
// we usually won't be done rendering the text before reaching our target row
size_t textpos = 0;
int ret;
const size_t MAXTOWRITE = 8;
bool collect_input = false;
while(textpos < textlen || y > targrow){
pthread_mutex_lock(lock);
ncplane_move_yx(rplane, y, x);
size_t towrite = strcspn(text + textpos, " \t\n") + 1;
if(towrite > MAXTOWRITE){
towrite = MAXTOWRITE;
}
if(towrite){
char* duped = strndup(text + textpos, towrite);
size_t bytes;