X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Fbase%2Flib_insnstr.c;fp=ncurses%2Fbase%2Flib_insnstr.c;h=16d945952b37fa1927dbf695b6d69ddd76d54731;hp=b6ddfde3c52b57117fce0aef7a8a180f40695c59;hb=26522e4669dbf45cba32138b5d81c6c292e88e60;hpb=18865150079f74b17047633094e3994516af8a41 diff --git a/ncurses/base/lib_insnstr.c b/ncurses/base/lib_insnstr.c index b6ddfde3..16d94595 100644 --- a/ncurses/base/lib_insnstr.c +++ b/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 #include -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.2 2009/05/30 14:53:49 tom Exp $") NCURSES_EXPORT(int) winsnstr(WINDOW *win, const char *s, int n) @@ -54,10 +54,12 @@ winsnstr(WINDOW *win, const char *s, int n) T((T_CALLED("winsnstr(%p,%s,%d)"), 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;