CID:1216560 Unchecked return value from ioctl
This commit is contained in:
parent
ead290870a
commit
e992c4c4d8
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue