mirror of
https://github.com/dankamongmen/notcurses.git
synced 2024-11-06 03:20:26 +00:00
zoo demo: feed ncplane_puttext() atomic words #897
This commit is contained in:
parent
1a0d28d8d0
commit
6d62470032
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user