]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/tty/tty_update.c
ncurses 5.9 - patch 20140201
[ncurses.git] / ncurses / tty / tty_update.c
index 3253e54937cb92e433bdb889a45b7717b8e5ed55..8a110ee92125e0e4fda4aa9033381e593706d802 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2012,2013 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2013,2014 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -82,7 +82,7 @@
 
 #include <ctype.h>
 
-MODULE_ID("$Id: tty_update.c,v 1.275 2013/01/20 00:34:46 tom Exp $")
+MODULE_ID("$Id: tty_update.c,v 1.277 2014/02/01 22:09:27 tom Exp $")
 
 /*
  * This define controls the line-breakout optimization.  Every once in a
@@ -490,7 +490,7 @@ can_clear_with(NCURSES_SP_DCLx ARG_CH_T ch)
        if (SP_PARM->_default_fg != C_MASK || SP_PARM->_default_bg != C_MASK)
            return FALSE;
        if ((pair = GetPair(CHDEREF(ch))) != 0) {
-           short fg, bg;
+           NCURSES_COLOR_T fg, bg;
            if (NCURSES_SP_NAME(pair_content) (NCURSES_SP_ARGx
                                               (short) pair,
                                               &fg, &bg) == ERR
@@ -1118,6 +1118,11 @@ ClrToEOS(NCURSES_SP_DCLx NCURSES_CH_T blank)
     row = SP_PARM->_cursrow;
     col = SP_PARM->_curscol;
 
+    if (row < 0)
+       row = 0;
+    if (col < 0)
+       col = 0;
+
     UpdateAttrs(SP_PARM, blank);
     TPUTS_TRACE("clr_eos");
     NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx