summaryrefslogtreecommitdiffstats
path: root/mbbsd/term.c
diff options
context:
space:
mode:
Diffstat (limited to 'mbbsd/term.c')
-rw-r--r--mbbsd/term.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/mbbsd/term.c b/mbbsd/term.c
index f58bbfb8..3d9fd793 100644
--- a/mbbsd/term.c
+++ b/mbbsd/term.c
@@ -52,9 +52,14 @@ outcf(int ch)
}
#endif
-static void
+static inline void
term_resize(int row, int col){
screenline_t *new_picture;
+
+ /* make sure reasonable size */
+ row = MAX(24, MIN(100, row));
+ col = MAX(80, MIN(200, col));
+
if (big_picture != NULL && row > t_lines) {
new_picture = (screenline_t *) calloc(row, sizeof(screenline_t));
if (new_picture == NULL) {
@@ -79,10 +84,6 @@ term_resize_catch(int sig)
signal(SIGWINCH, SIG_IGN); /* Don't bother me! */
ioctl(0, TIOCGWINSZ, &newsize);
- /* make sure reasonable size */
- newsize.ws_row = MAX(24, MIN(100, newsize.ws_row));
- newsize.ws_col = MAX(80, MIN(200, newsize.ws_col));
-
term_resize(newsize.ws_row, newsize.ws_col);
signal(SIGWINCH, term_resize_catch);