Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libedit check for negative return of ct_visual_char (Kam...
details: https://anonhg.NetBSD.org/src/rev/30d1865ae716
branches: trunk
changeset: 771297:30d1865ae716
user: christos <christos%NetBSD.org@localhost>
date: Fri Nov 18 20:25:48 2011 +0000
description:
check for negative return of ct_visual_char (Kamil Dudka)
diffstat:
lib/libedit/terminal.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diffs (27 lines):
diff -r b4cd9b914d27 -r 30d1865ae716 lib/libedit/terminal.c
--- a/lib/libedit/terminal.c Fri Nov 18 20:24:21 2011 +0000
+++ b/lib/libedit/terminal.c Fri Nov 18 20:25:48 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: terminal.c,v 1.10 2011/10/04 15:27:04 christos Exp $ */
+/* $NetBSD: terminal.c,v 1.11 2011/11/18 20:25:48 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)term.c 8.2 (Berkeley) 4/30/95";
#else
-__RCSID("$NetBSD: terminal.c,v 1.10 2011/10/04 15:27:04 christos Exp $");
+__RCSID("$NetBSD: terminal.c,v 1.11 2011/11/18 20:25:48 christos Exp $");
#endif
#endif /* not lint && not SCCSID */
@@ -1262,6 +1262,8 @@
{
Char visbuf[VISUAL_WIDTH_MAX +1];
ssize_t vcnt = ct_visual_char(visbuf, VISUAL_WIDTH_MAX, c);
+ if (vcnt < 0)
+ vcnt = 0;
visbuf[vcnt] = '\0';
terminal_overwrite(el, visbuf, (size_t)vcnt);
terminal__flush(el);
Home |
Main Index |
Thread Index |
Old Index