summaryrefslogtreecommitdiff
path: root/lib/libcurses/lib_insstr.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1997-11-26 04:02:03 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1997-11-26 04:02:03 +0000
commitbda33b7e716d56bf1a9ecccb7e2543889f9ab1d3 (patch)
tree7bc4bcdf70ecc1d045693a309e96b304e1b49c33 /lib/libcurses/lib_insstr.c
parentcd15e61d557c4704743905eae7b88ae927cf0394 (diff)
ncurses 4.1 + changes to work with our terminfo libs (instead of
the ncurses ones). Changes are #ifdef EXTERN_TERMINFO. Post 4.1 patches will be applied in a separate commit.
Diffstat (limited to 'lib/libcurses/lib_insstr.c')
-rw-r--r--lib/libcurses/lib_insstr.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/libcurses/lib_insstr.c b/lib/libcurses/lib_insstr.c
index 1d1d867ecc8..c25071f76d5 100644
--- a/lib/libcurses/lib_insstr.c
+++ b/lib/libcurses/lib_insstr.c
@@ -28,18 +28,20 @@
**
*/
-#include "curses.priv.h"
+#include <curses.priv.h>
#include <ctype.h>
+MODULE_ID("Id: lib_insstr.c,v 1.9 1997/02/15 16:09:53 tom Exp $")
+
int winsnstr(WINDOW *win, const char *str, int n)
{
short oy = win->_cury;
short ox = win->_curx;
-char *cp;
+const char *cp;
- T(("winsstr(%p,'%s',%d) called", win, str, n));
+ T((T_CALLED("winsstr(%p,%s,%d)"), win, _nc_visbuf(str), n));
- for (cp = (char *)str; *cp && (n <= 0 || (cp - str) < n); cp++) {
+ for (cp = str; *cp && (n <= 0 || (cp - str) < n); cp++) {
if (*cp == '\n' || *cp == '\r' || *cp == '\t' || *cp == '\b')
_nc_waddch_nosync(win, (chtype)(*cp));
else if (is7bits(*cp) && iscntrl(*cp)) {
@@ -53,9 +55,9 @@ char *cp;
if (win->_curx > win->_maxx)
win->_curx = win->_maxx;
}
-
+
win->_curx = ox;
win->_cury = oy;
_nc_synchook(win);
- return OK;
+ returnCode(OK);
}