fix a bug of terminfo()