From b7d33bdc3cc3d60cd23410372f908a8fb5b5a728 Mon Sep 17 00:00:00 2001 From: Sadrul Habib Chowdhury Date: Thu, 18 Feb 2010 14:30:41 -0500 Subject: 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. --- src/process.c | 4 ++-- 1 file 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; -- cgit v1.2.1