Off screen windows!!!!!!
[unix-history] / usr / src / usr.bin / window / cmd1.c
index cdc9f28..b4ae41a 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char *sccsid = "@(#)cmd1.c      3.10 83/08/31";
+static char *sccsid = "@(#)cmd1.c      3.11 83/09/14";
 #endif
 
 #include "defs.h"
 #endif
 
 #include "defs.h"
@@ -149,8 +149,9 @@ int id, nrow, ncol, row, col;
 
        if (id < 0 && (id = findid()) < 0)
                return 0;
 
        if (id < 0 && (id = findid()) < 0)
                return 0;
-       if (row <= 0) {
-               error("Bad row number.");
+       if (row + nrow <= 0 || row > wwnrow - 1
+           || col + ncol <= 0 || col > wwncol - 1) {
+               error("Illegal window size or position.");
                return 0;
        }
        if ((w = wwopen(WWO_PTY, nrow, ncol, row, col, nline)) == 0) {
                return 0;
        }
        if ((w = wwopen(WWO_PTY, nrow, ncol, row, col, nline)) == 0) {