]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/base/lib_newwin.c
ncurses 5.0
[ncurses.git] / ncurses / base / lib_newwin.c
similarity index 97%
rename from ncurses/lib_newwin.c
rename to ncurses/base/lib_newwin.c
index d96bf0a4e58e1b5358428b31fba08ad42e7da3ff..d7fc02b3216e0e0089663d0a2aa4e856f8c1f55e 100644 (file)
@@ -42,7 +42,7 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_newwin.c,v 1.19 1998/02/11 12:13:54 tom Exp $")
+MODULE_ID("$Id: lib_newwin.c,v 1.21 1999/10/03 00:42:03 tom Exp $")
 
 void _nc_freewin(WINDOW *win)
 {
@@ -60,7 +60,7 @@ int   i;
 
                                if (! (win->_flags & _SUBWIN)) {
                                        for (i = 0; i <= win->_maxy && win->_line[i].text; i++)
-                                               free(win->_line[i].text);
+                                               FreeIfNeeded(win->_line[i].text);
                                }
                                free(win->_line);
                                free(win);
@@ -130,10 +130,10 @@ int     flags = _SUBWIN;
            returnWin(0);
 
        if (num_lines == 0)
-           num_lines = orig->_maxy - begy;
+           num_lines = orig->_maxy + 1 - begy; 
 
        if (num_columns == 0)
-           num_columns = orig->_maxx - begx;
+           num_columns = orig->_maxx + 1 - begx; 
 
        if (orig->_flags & _ISPAD)
          flags |= _ISPAD;