diff options
author | brian <brian@FreeBSD.org> | 1997-07-07 13:42:42 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 1997-07-07 13:42:42 +0000 |
commit | 6afea978afce0f8cbbb59cd83f2d1a1bca875b6f (patch) | |
tree | de5882c6be3ab2de07f47cca72e2f9b438c9acab /sys/i386/isa/syscons.c | |
parent | 2085f6372a9e9e2de0b2a2448efd23ea037fa767 (diff) | |
download | FreeBSD-src-6afea978afce0f8cbbb59cd83f2d1a1bca875b6f.zip FreeBSD-src-6afea978afce0f8cbbb59cd83f2d1a1bca875b6f.tar.gz |
YAMF2.2: Handle indirect results of "kbdcontrol -h X"
where X < 25.
Diffstat (limited to 'sys/i386/isa/syscons.c')
-rw-r--r-- | sys/i386/isa/syscons.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/i386/isa/syscons.c b/sys/i386/isa/syscons.c index eb2b0ad..0f263d4 100644 --- a/sys/i386/isa/syscons.c +++ b/sys/i386/isa/syscons.c @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: syscons.c,v 1.219 1997/06/29 22:23:32 ache Exp $ + * $Id: syscons.c,v 1.220 1997/06/30 13:31:49 yokota Exp $ */ #include "sc.h" @@ -775,7 +775,8 @@ scclose(dev_t dev, int flag, int mode, struct proc *p) } else { free(scp->scr_buf, M_DEVBUF); - free(scp->history, M_DEVBUF); + if (scp->history != NULL) + free(scp->history, M_DEVBUF); free(scp, M_DEVBUF); console[minor(dev)] = NULL; } @@ -957,7 +958,8 @@ scioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p) case CONS_HISTORY: /* set history size */ if (*data) { - free(scp->history, M_DEVBUF); + if (scp->history != NULL) + free(scp->history, M_DEVBUF); scp->history_size = *(int*)data; if (scp->history_size < scp->ysize) scp->history = NULL; @@ -3127,7 +3129,8 @@ next_code: (cur_console->xsize*i), cur_console->xsize * sizeof(u_short)); ptr += cur_console->xsize; - if (ptr + cur_console->xsize > + if (cur_console->history && + ptr + cur_console->xsize > cur_console->history + cur_console->history_size) ptr = cur_console->history; |