summaryrefslogtreecommitdiffstats
path: root/lib/libedit/tty.c
diff options
context:
space:
mode:
authorstefanf <stefanf@FreeBSD.org>2007-03-11 21:47:40 +0000
committerstefanf <stefanf@FreeBSD.org>2007-03-11 21:47:40 +0000
commit176735320e11768e9f5b034525cd406666c745a6 (patch)
tree7c5a511c1579d52e93b7e0c88360011ccae165db /lib/libedit/tty.c
parent50b3f4c302935f38be277cc4f2b41c73be99018b (diff)
downloadFreeBSD-src-176735320e11768e9f5b034525cd406666c745a6.zip
FreeBSD-src-176735320e11768e9f5b034525cd406666c745a6.tar.gz
Merge the following changes from NetBSD:
history.c 1.32: # Fix memory leak found by valgrind (Julien Torres) map.c 1.24: # fix debugging printf format. read.c 1.40: # Fix bug with multiple pending el_pushes. Reported by Julien Torres. tty.c 1.24: # Coverity CID 1216: Prevent negative index use. MFC after: 3 weeks
Diffstat (limited to 'lib/libedit/tty.c')
-rw-r--r--lib/libedit/tty.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/libedit/tty.c b/lib/libedit/tty.c
index e2b9932..fca3c2b 100644
--- a/lib/libedit/tty.c
+++ b/lib/libedit/tty.c
@@ -29,7 +29,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $NetBSD: tty.c,v 1.23 2005/06/01 11:37:52 lukem Exp $
+ * $NetBSD: tty.c,v 1.24 2006/03/18 09:07:05 christos Exp $
*/
#if !defined(lint) && !defined(SCCSID)
@@ -1149,10 +1149,14 @@ tty_stty(EditLine *el, int argc __unused, const char **argv)
st = len =
strlen(el->el_tty.t_t[z][m->m_type].t_name);
}
- x = (el->el_tty.t_t[z][i].t_setmask & m->m_value)
- ? '+' : '\0';
- x = (el->el_tty.t_t[z][i].t_clrmask & m->m_value)
- ? '-' : x;
+ if (i != -1) {
+ x = (el->el_tty.t_t[z][i].t_setmask & m->m_value)
+ ? '+' : '\0';
+ x = (el->el_tty.t_t[z][i].t_clrmask & m->m_value)
+ ? '-' : x;
+ } else {
+ x = '\0';
+ }
if (x != '\0' || aflag) {
OpenPOWER on IntegriCloud