xbps-bin: get_maxcols(): use stdin to make it work in all cases (from xdave).

This commit is contained in:
Juan RP 2012-08-01 07:47:40 +02:00
parent 1be90e57d7
commit 01c2dcaca7

View File

@ -221,7 +221,7 @@ get_maxcols(void)
{
struct winsize ws;
if (ioctl(1, TIOCGWINSZ, &ws) == 0)
if (ioctl(fileno(stdin), TIOCGWINSZ, &ws) == 0)
return ws.ws_col;
return 80;