Patch from David Daney:
[oweals/busybox.git] / libbb / get_terminal_width_height.c
index ef90463fb69ef25ada9cef702c1c75814e6c1caf..7a1af6dc1dfb29a28a07ce7b22a44ccf6b10922a 100644 (file)
@@ -36,7 +36,7 @@ void get_terminal_width_height(int fd, int *width, int *height)
 {
        struct winsize win = { 0, 0, 0, 0 };
 #ifdef CONFIG_FEATURE_AUTOWIDTH
-       if (ioctl(0, TIOCGWINSZ, &win) != 0) {
+       if (ioctl(fd, TIOCGWINSZ, &win) != 0) {
                win.ws_row = 24;
                win.ws_col = 80;
        }