Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libcurses Remove bogus length check - SUSV2 says add(n)s...
details: https://anonhg.NetBSD.org/src/rev/5377b256bce4
branches: trunk
changeset: 797284:5377b256bce4
user: blymn <blymn%NetBSD.org@localhost>
date: Sun Jul 13 01:58:08 2014 +0000
description:
Remove bogus length check - SUSV2 says add(n)str wraps and performs
special character processing so we should not be trying to limit the
length to the screen edge. This partially fixes PR 48827, the test case
works now.
diffstat:
lib/libcurses/addnstr.c | 9 ++-------
1 files changed, 2 insertions(+), 7 deletions(-)
diffs (35 lines):
diff -r e8409e0222ba -r 5377b256bce4 lib/libcurses/addnstr.c
--- a/lib/libcurses/addnstr.c Sun Jul 13 01:46:04 2014 +0000
+++ b/lib/libcurses/addnstr.c Sun Jul 13 01:58:08 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: addnstr.c,v 1.13 2012/09/28 06:07:05 blymn Exp $ */
+/* $NetBSD: addnstr.c,v 1.14 2014/07/13 01:58:08 blymn Exp $ */
/*
* Copyright (c) 1993, 1994
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)addnstr.c 8.2 (Berkeley) 5/4/94";
#else
-__RCSID("$NetBSD: addnstr.c,v 1.13 2012/09/28 06:07:05 blymn Exp $");
+__RCSID("$NetBSD: addnstr.c,v 1.14 2014/07/13 01:58:08 blymn Exp $");
#endif
#endif /* not lint */
@@ -147,16 +147,11 @@
* ncurses: if (n >= 0) then "at most n", else "len = strlen(s)"
* XCURSES: if (n != -1) then "at most n", else "len = strlen(s)"
*
- * Also SUSv2 says these functions do not wrap nor change the
- * cursor position.
*/
if (n >= 0)
for (p = s, len = 0; n-- && *p++; ++len);
else
len = strlen(s);
- if (len > (win->maxx - win->curx))
- len = win->maxx - win->curx;
-
return(waddbytes(win, s, (int) len));
}
Home |
Main Index |
Thread Index |
Old Index