]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
CID:1216560 Unchecked return value from ioctl
authorMichael Jerris <mike@jerris.com>
Mon, 2 Jun 2014 14:10:59 +0000 (14:10 +0000)
committerMichael Jerris <mike@jerris.com>
Mon, 2 Jun 2014 14:11:07 +0000 (14:11 +0000)
libs/esl/fs_cli.c

index b7b764427d850db71ce1892e4d373807c3905c1a..55b299b57024eed150bffe8712ab7d3c933be523 100644 (file)
@@ -139,10 +139,10 @@ static void screen_size(int *x, int *y)
 
 #elif defined(TIOCGWINSZ)
        struct winsize w;
-       ioctl(0, TIOCGWINSZ, &w);
-
-       if (x) *x = w.ws_col;
-       if (y) *y = w.ws_row;
+       if ( (ioctl(0, TIOCGWINSZ, &w)) >= 0 ) {
+               if (x) *x = w.ws_col;
+               if (y) *y = w.ws_row;
+       }
 #else
        if (x) *x = 80;
        if (y) *y = 24;