screensize: Dereference pointers when checking cols/rows
authorMatt Fleming <matt.fleming@intel.com>
Tue, 27 Nov 2012 16:03:36 +0000 (16:03 +0000)
committerMatt Fleming <matt.fleming@intel.com>
Tue, 27 Nov 2012 20:48:33 +0000 (20:48 +0000)
Dereference 'rows' and 'cols' to check whether the data they point to
is zero, which would indicate the screen size is bogus, instead of
checking if they point to NULL.

Signed-off-by: Matt Fleming <matt.fleming@intel.com>
com32/lib/sys/screensize.c

index 340227c..bcd4496 100644 (file)
@@ -14,7 +14,7 @@ int getscreensize(int fd, int *rows, int *cols)
     *rows = fp->o.rows;
     *cols = fp->o.cols;
 
-    if (!rows || !cols) {
+    if (!*rows || !*cols) {
        errno = ENOTTY;
        return -1;
     }