On 07.02.2021 05:25, Valery Ushakov wrote:
What's wrong is that for addstr we call _cursesi_addwchar with a pointer to a dummy variable, but for addch we call it with a pointer to win->curx, so we first increment win->curx in the nested _cursesi_addwchar calls (for the spaces) and then we also increment it in the top-level _cursesi_addwchar in that loop.
Thanks for this explanation, it seemed to provide all the details I needed to fix it myself. I tried it but failed miserably since I stumpled upon a dozen other bugs while trying to fix this one. Therefore I first made the libcurses test framework a little more reliable. Could you perhaps fix this one? You know the code way better than I do, with all the subtleties around aliasing and SYNCH_IN and SYNCH_OUT and the various code paths that are taken by all the functions. Roland