summaryrefslogtreecommitdiff
path: root/ncurses/widechar/lib_ins_wch.c
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2021-10-20 23:22:45 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2021-10-20 23:22:45 +0000
commit332fa27640b1901ac632e6d37a4aa9643d0f8594 (patch)
treebfb5303e24d1cd4ddd22df12f45a013fefb9ca23 /ncurses/widechar/lib_ins_wch.c
parentff448436b2b70771d09b8d5ff34a509dcf02f81b (diff)
downloadncurses-332fa27640b1901ac632e6d37a4aa9643d0f8594.tar.gz
Diffstat (limited to 'ncurses/widechar/lib_ins_wch.c')
-rw-r--r--ncurses/widechar/lib_ins_wch.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ncurses/widechar/lib_ins_wch.c b/ncurses/widechar/lib_ins_wch.c
index a744f5b..f753610 100644
--- a/ncurses/widechar/lib_ins_wch.c
+++ b/ncurses/widechar/lib_ins_wch.c
@@ -40,7 +40,7 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_ins_wch.c,v 1.24 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: lib_ins_wch.c,v 1.25 2020/12/05 20:04:59 tom Exp $")
/*
* Insert the given character, updating the current location to simplify
@@ -111,7 +111,7 @@ wins_nwstr(WINDOW *win, const wchar_t *wstr, int n)
if (win != 0
&& wstr != 0) {
if (n < 1)
- n = (int) wcslen(wstr);
+ n = INT_MAX;
code = OK;
if (n > 0) {
@@ -120,7 +120,7 @@ wins_nwstr(WINDOW *win, const wchar_t *wstr, int n)
NCURSES_SIZE_T oy = win->_cury;
NCURSES_SIZE_T ox = win->_curx;
- for (cp = wstr; ((cp - wstr) < n) && *cp; cp++) {
+ for (cp = wstr; (*cp != L'\0') && ((cp - wstr) < n); cp++) {
int len = _nc_wacs_width(*cp);
if ((len >= 0 && len != 1) || !is7bits(*cp)) {