Module Name: src
Committed By: christos
Date: Wed Jul 22 15:58:09 UTC 2009
Modified Files:
src/lib/libedit: tty.c
Log Message:
Don't depend on side effects inside an assert
>From Michael Cook mcook at bbn dot com
To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/lib/libedit/tty.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/lib/libedit/tty.c
diff -u src/lib/libedit/tty.c:1.30 src/lib/libedit/tty.c:1.31
--- src/lib/libedit/tty.c:1.30 Sun Feb 15 19:15:45 2009
+++ src/lib/libedit/tty.c Wed Jul 22 11:58:09 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: tty.c,v 1.30 2009/02/16 00:15:45 christos Exp $ */
+/* $NetBSD: tty.c,v 1.31 2009/07/22 15:58:09 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)tty.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: tty.c,v 1.30 2009/02/16 00:15:45 christos Exp $");
+__RCSID("$NetBSD: tty.c,v 1.31 2009/07/22 15:58:09 christos Exp $");
#endif
#endif /* not lint && not SCCSID */
@@ -1285,7 +1285,8 @@
int c = ffs((int)m->m_value);
int v = *++p ? parse__escape((const char **) &p) :
el->el_tty.t_vdisable;
- assert(c-- != 0);
+ assert(c != 0);
+ c--;
c = tty__getcharindex(c);
assert(c != -1);
tios->c_cc[c] = v;