summaryrefslogtreecommitdiffstats
path: root/contrib/ncurses/ncurses/base/lib_insnstr.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/ncurses/ncurses/base/lib_insnstr.c')
-rw-r--r--contrib/ncurses/ncurses/base/lib_insnstr.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/contrib/ncurses/ncurses/base/lib_insnstr.c b/contrib/ncurses/ncurses/base/lib_insnstr.c
index b6ddfde..ce03e64 100644
--- a/contrib/ncurses/ncurses/base/lib_insnstr.c
+++ b/contrib/ncurses/ncurses/base/lib_insnstr.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 2004 Free Software Foundation, Inc. *
+ * Copyright (c) 2004,2009 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -40,7 +40,7 @@
#include <curses.priv.h>
#include <ctype.h>
-MODULE_ID("$Id: lib_insnstr.c,v 1.1 2004/02/28 23:44:56 tom Exp $")
+MODULE_ID("$Id: lib_insnstr.c,v 1.3 2009/10/24 22:04:35 tom Exp $")
NCURSES_EXPORT(int)
winsnstr(WINDOW *win, const char *s, int n)
@@ -51,13 +51,15 @@ winsnstr(WINDOW *win, const char *s, int n)
const unsigned char *str = (const unsigned char *) s;
const unsigned char *cp;
- T((T_CALLED("winsnstr(%p,%s,%d)"), win, _nc_visbufn(s, n), n));
+ T((T_CALLED("winsnstr(%p,%s,%d)"), (void *) win, _nc_visbufn(s, n), n));
if (win != 0 && str != 0) {
+ SCREEN *sp = _nc_screen_of(win);
+
oy = win->_cury;
ox = win->_curx;
for (cp = str; *cp && (n <= 0 || (cp - str) < n); cp++) {
- _nc_insert_ch(win, (chtype) UChar(*cp));
+ _nc_insert_ch(sp, win, (chtype) UChar(*cp));
}
win->_curx = ox;
win->_cury = oy;
OpenPOWER on IntegriCloud