diff options
author | Sadrul Habib Chowdhury <sadrul@users.sourceforge.net> | 2010-02-18 14:30:41 -0500 |
---|---|---|
committer | Sadrul Habib Chowdhury <sadrul@users.sourceforge.net> | 2010-02-18 14:30:41 -0500 |
commit | b7d33bdc3cc3d60cd23410372f908a8fb5b5a728 (patch) | |
tree | 9de4ff924e090b856f524513146e7a0902f442fe | |
parent | 75441d0e47f3bcc077bf1875b1338a385f6d77d9 (diff) | |
download | screen-b7d33bdc3cc3d60cd23410372f908a8fb5b5a728.tar.gz |
Fix creating numbered windows.
This is another bug introduced when the max number of windows was
made configurable. Bug reported by Christian Ebert in
<20100218160955.GC21624@krille.blacktrash.org>.
And fix a typo.
-rw-r--r-- | src/process.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/process.c b/src/process.c index c1d2da1..3ea86cb 100644 --- a/src/process.c +++ b/src/process.c @@ -4105,7 +4105,7 @@ int key; else { if (!windows) - wtab = realloc(wtab, n * sizeof(struct win)); + wtab = realloc(wtab, n * sizeof(struct win *)); maxwin = n; } break; @@ -5978,7 +5978,7 @@ char *fn, **av; if (*buf != '\0') nwin.aka = buf; num = atoi(*av); - if (num < 0 || num > maxwin - 1) + if (num < 0 || (maxwin && num > maxwin - 1) || (!maxwin && num > MAXWIN - 1)) { Msg(0, "%s: illegal screen number %d.", fn, num); num = 0; |