waddstr(win, s); getyx(win, y, x); wrefresh(win);
void dupdstatw(WINDOW * win, char *s, int add){    static char infostr[80];    static int y, x;    static int oldlen;    int l, cnt;    if (add) {	oldlen = 0;	strcpy(infostr, s);	if (win == NULL) {	    printf("  %s", s);	    return;	}	waddstr(win, s);	getyx(win, y, x);	wrefresh(win);	return;    }    if (win == NULL) {	printf("\r  %s%s", infostr, s);    } else {	mvwaddstr(win, y, x, s);    }    if (oldlen > strlen(s)) {	l = oldlen - strlen(s);	for (cnt = 0; cnt < l; cnt++)	    if (win == NULL)		printf(" ");	    else		waddch(win, ' ');    }    if (win == NULL) {	fflush(stdout);    } else {	wrefresh(win);    }    oldlen = strlen(s);}